NXSL:localtime
Revision as of 10:09, 18 April 2012 by AlexKirhenshtein (talk | contribs) (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...")
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:
Attribute | Synonym | Meaning |
---|---|---|
sec | tm_sec | Seconds after the minute |
min | tm_min | Minutes after the hour |
hour | tm_hour | Hours since midnight |
mday | tm_mday | Day of the month |
mon | tm_mon | Months since January |
year | tm_year | Year |
wday | tm_wday | Days since Sunday |
yday | tm_yday | Days since January 1 |
isdst | tm_isdst | Daylight Saving Time flag |
Examples
localtime(time())->year
Result: 2012