Function __global->usertime_to_utctime

Definitions

sources/temporal.php

  • Convert a user timestamp to a UTC timestamp. This is not a function to use much- you probably want utctime_to_usertime.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 user timestamp to a UTC timestamp. This is not a function to use much- you probably want utctime_to_usertime.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 usertime_to_utctime(?int $timestamp = null, ?int $member_id = null) : int