localtime

array localtime([int timestamp], [bool associative]) 
timestamp UNIX timestamp
associative Whether to return an associative or indexed array

Returns an array containing the time components of a UNIX timestamp.

Returns:

Array of time components; FALSE on error

Description:

localtime() executes the system’s localtime() system call and returns its results in a PHP array. If the associative parameter given is TRUE, the returned array will be an associative array with the key names from the following table; otherwise, the returned array will be indexed starting from 0. If no argument is given for associative , the default is FALSE.

The following table describes the elements of the returned array.

Indexed Key Associative Key Value

Get PHP Functions Essential Reference 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.