Extracted from Pike v7.4 release 97 at 2004-08-02.
pike.ida.liu.se
[Top]
predef::

Method localtime()


Method localtime

mapping(string:int) localtime(int timestamp)

Description

Convert seconds since 00:00:00 UTC, Jan 1, 1970 into components.

Returns

This function returns a mapping with the following components:

"sec" : int(0..60)

Seconds over the minute.

"min" : int(0..59)

Minutes over the hour.

"hour" : int(0..23)

Hour of the day.

"mday" : int(1..31)

Day of the month.

"mon" : int(0..11)

Month of the year.

"year" : int(0..)

Year since 1900.

"wday" : int(0..6)

Day of week (0 = Sunday).

"yday" : int(0..365)

Day of the year.

"isdst" : int(0..1)

Is daylight savings time.

"timezone" : int

Offset from UTC.


An error is thrown if the localtime(2) call failed on the system. It's platform dependent what time ranges that function can handle, e.g. Windows doesn't handle a negative timestamp .

Note

The field "timezone" may not be available on all platforms.

See also

Calendar , gmtime() , time() , ctime() , mktime()