Symisc Systems

Libcox Command Reference


Star Follow @symisc

Command Syntax

localtime [timestamp = time()] [is_associative = false]


Alias

None


Description

Returns an associative array containing the local time information (all the different elements of the structure returned by the C function call to localtime()). The following array entries are returned:


Parameters

timestamp

Optional Parameter: The optional timestamp parameter is an integer Unix timestamp that defaults to the current local time if a timestamp is not given. In other words, it defaults to the value of time().

is_associative

Optional Parameter: If set to FALSE or not supplied then the array is returned as a regular, numerically indexed array. If the argument is set to TRUE then localtime() returns an associative array containing all the different elements of the structure returned by the C function call to localtime().


Return Value

Array: An associative array of information related to the timestamp. Use libcox_array_next_elem() or libcox_array_walk() to iterate over the array elements, libcox_array_fetch() or libcox_array_fetch_by_key() to extract array entries by indexes or keys.