Name

localtime

Synopsis

array localtime([int timestamp[, bool associative])

Returns an array of values as given by the C function of the same name. The first argument is the timestamp; if the second argument is provided and is true, the values are returned as an associative array. If the second argument is not provided or is false, a numeric array is returned. The keys and values returned are:

tm_sec

Seconds

tm_min

Minutes

tm_hour

Hour

tm_mday

Day of the month

tm_mon

Month of the year

tm_year

Number of years since 1900

tm_wday

Day of the week

tm_yday

Day of the year

tm_isdst

1 if Daylight Savings Time was in effect at the date and time

If a numeric array is returned, the values are in the order given above.

Get Programming PHP, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.