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] => 22
[1] => 16
[2] => 23
[3] => 16
[4] => 0
[5] => 121
[6] => 6
[7] => 15
[8] => 0
)
Array
(
[tm_sec] => 22
[tm_min] => 16
[tm_hour] => 23
[tm_mday] => 16
[tm_mon] => 0
[tm_year] => 121
[tm_wday] => 6
[tm_yday] => 15
[tm_isdst] => 0
)