display_time_period (line 36)
Display a time period in a tidy human-readable way.
string
display_time_period
(integer $seconds)
-
integer
$seconds: Number of seconds
get_input_date (line 258)
Check a POST inputted date for validity, and get the Unix timestamp for the inputted date.
?TIME
get_input_date
(ID_TEXT $stub, [boolean $get_also = false])
-
ID_TEXT
$stub: The stub of the parameter name (stub_year, stub_month, stub_day, stub_hour, stub_minute)
-
boolean
$get_also: Whether to allow over get parameters also
get_relative_timezone (line 64)
Get the relative timezone in order to calculate user time. The relative timezone takes into account both the website's offset from the server time, and the user's offset from the website's time.
float
get_relative_timezone
([?MEMBER $member = NULL])
-
?MEMBER
$member: Member for which the date is being rendered (NULL: current member)
get_timezoned_date (line 155)
Get a nice formatted date from the specified Unix timestamp.
string
get_timezoned_date
(TIME $timestamp, [boolean $include_time = true], [boolean $verbose = false], [boolean $server_time = false], [boolean $avoid_contextual_dates = false], [?MEMBER $member = NULL])
-
TIME
$timestamp: Input timestamp
-
boolean
$include_time: Whether to include the time in the output
-
boolean
$verbose: Whether to make this a verbose date (longer than usual)
-
boolean
$server_time: Whether to work in server time
-
boolean
$avoid_contextual_dates: Whether contextual dates will be avoided
-
?MEMBER
$member: Member for which the date is being rendered (NULL: current member)
get_timezoned_time (line 238)
Get a nice formatted time from the specified Unix timestamp.
string
get_timezoned_time
(TIME $timestamp, [boolean $avoid_contextual_dates = false], [?MEMBER $member = NULL])
-
TIME
$timestamp: Input timestamp
-
boolean
$avoid_contextual_dates: Whether contextual times will be avoided. Note that we don't currently use contextual (relative) times. This parameter may be used in the future.
-
?MEMBER
$member: Member for which the time is being rendered (NULL: current member)
init__temporal (line 24)
Standard code module initialisation function.
void
init__temporal
()
locale_filter (line 221)
Filter locale-tainted strings through the locale filter.
Let's pretend a user's operating system doesn't fully support they're locale. They have a nice language pack, but whenever the O.S. is asked for dates in the chosen locale, it puts month names in English instead. The locale_filter function is used to cleanup these problems. It does a simple set of string replaces, as defined by the 'locale_subst' language string.
string
locale_filter
(string $ret)
-
string
$ret: Tainted string
make_locale_filter (line 47)
Set up the locale filter array from the terse language string specifying it.
void
make_locale_filter
()
my_strftime (line 137)
Format a local time/date according to locale settings. Combines best features of 'strftime' and 'date'.
string
my_strftime
(string $format, [?TIME $timestamp = NULL])
-
string
$format: The formatting string.
-
?TIME
$timestamp: The timestamp (NULL: now).
servertime_to_usertime (line 104)
Convert a server timestamp to a user timestamp. The user timestamp should not be pumped through get_timezoned_date as this already performs the conversions internally.
What complicate 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 GMT. "user time" is offsetted to compensate, a virtual construct.
TIME
servertime_to_usertime
([?TIME $timestamp = NULL], [?MEMBER $member = NULL])
-
?TIME
$timestamp: Input timestamp (NULL: now)
-
?MEMBER
$member: Member for which the date is being rendered (NULL: current member)
usertime_to_servertime (line 121)
Convert a user timestamp to a server timestamp. This is not a function to use much- you probably want servertime_to_usertime.
What complicate 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 GMT. "user time" is offsetted to compensate, a virtual construct.
TIME
usertime_to_servertime
([?TIME $timestamp = NULL], [?MEMBER $member = NULL])
-
?TIME
$timestamp: Input timestamp (NULL: now)
-
?MEMBER
$member: Member for which the date is being rendered (NULL: current member)