Difference between revisions of "NXSL:localtime"

154 bytes added ,  10:11, 18 April 2012
no edit summary
(Created page with "Converts time in UNIX format (number of seconds since epoch) to calendar date and time broken down into its components. Function uses either time given in time argument or cur...")
 
Line 1: Line 1:
<syntaxhighlight>localtime([time])</syntaxhighlight>
Converts time in UNIX format (number of seconds since epoch) to calendar date and time broken down into its components. Function uses either time given in time argument or current time if time is omitted. Return value is an object of class TIME with the following attributes:
Converts time in UNIX format (number of seconds since epoch) to calendar date and time broken down into its components. Function uses either time given in time argument or current time if time is omitted. Return value is an object of class TIME with the following attributes:
{| class="wikitable"
{| class="wikitable"
Line 24: Line 26:


== Examples ==
== Examples ==
<syntaxhighlight>localtime(time())->year
<syntaxhighlight>localtime(time())->year</syntaxhighlight>
 
Result: 2012 (integer)
 
Equivalent:
<syntaxhighlight>localtime()->year</syntaxhighlight>


Result: 2012</syntaxhighlight>
Result: 2012 (integer)