Function __global->utctime_to_usertime
Definitions
sources/temporal.php
- Convert a UTC timestamp to a user timestamp. The user timestamp should not be pumped through get_timezoned_* as this already performs the conversions internally.What complicates understanding of matters is that "user time" is not the timestamp that would exist on a user's PC, as all timestamps are meant to be stored in UTC. "user time" is offsetted to compensate, a virtual construct.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: int
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $timestamp | ?TIME | No | No | Null | N/A | N/A | Input timestamp (null: now) |
| $member_id | ?MEMBER | No | No | Null | N/A | N/A | Member for which the date is being rendered (null: current member) |
Returns
- Output timestamp
- Type: TIME
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Convert a UTC timestamp to a user timestamp. The user timestamp should not be pumped through get_timezoned_* as this already performs the conversions internally.What complicates understanding of matters is that "user time" is not the timestamp that would exist on a user's PC, as all timestamps are meant to be stored in UTC. "user time" is offsetted to compensate, a virtual construct.
*
* @param ?TIME $timestamp Input timestamp (null: now)
* @param ?MEMBER $member_id Member for which the date is being rendered (null: current member)
* @return TIME Output timestamp
*/
function utctime_to_usertime(?int $timestamp = null, ?int $member_id = null) : int
* Convert a UTC timestamp to a user timestamp. The user timestamp should not be pumped through get_timezoned_* as this already performs the conversions internally.What complicates understanding of matters is that "user time" is not the timestamp that would exist on a user's PC, as all timestamps are meant to be stored in UTC. "user time" is offsetted to compensate, a virtual construct.
*
* @param ?TIME $timestamp Input timestamp (null: now)
* @param ?MEMBER $member_id Member for which the date is being rendered (null: current member)
* @return TIME Output timestamp
*/
function utctime_to_usertime(?int $timestamp = null, ?int $member_id = null) : int

