localtime
Get the local time
Syntax
localtime ([ int $timestamp = time() [, bool $is_associative = FALSE ]] ) : array
Parameters
timestamp
The optional timestamp parameter is an integer Unix timestamp that defaults to the current local time if a timestamp is not given. In other words, it defaults to the value of time().
is_associative
If set to FALSE or not supplied then the array is returned as a regular, numerically indexed array. If the argument is set to TRUE then localtime() returns an associative array containing all the different elements of the structure returned by the C function call to localtime. The names of the different keys of the associative array are as follows:
"tm_sec" | seconds, 0 to 59 |
"tm_min" | minutes, 0 to 59 |
"tm_hour" | hours, 0 to 23 |
"tm_mday" | day of the month, 1 to 31 |
"tm_mon" | month of the year, 0 (Jan) to 11 (Dec) |
"tm_year" | years since 1900 |
"tm_wday" | day of the week, 0 (Sun) to 6 (Sat) |
"tm_yday" | day of the year, 0 to 365 |
"tm_isdst" | is daylight savings time in effect? Positive if yes, 0 if not, negative if unknown. |
Return
Examples
Array ( [0] => 59 [1] => 26 [2] => 21 [3] => 10 [4] => 3 [5] => 121 [6] => 6 [7] => 99 [8] => 0 ) Array ( [tm_sec] => 59 [tm_min] => 26 [tm_hour] => 21 [tm_mday] => 10 [tm_mon] => 3 [tm_year] => 121 [tm_wday] => 6 [tm_yday] => 99 [tm_isdst] => 0 )