PHP localtime () Function Example Tutorial
Definitions and usage
The local time () function returns an array that contains the time component of the Unix timestamp.
Grammar
LocalTime (timestamp,is_associative)
parameter |
description |
timestamp |
optional. Specifies the date or time is formatted. If no timestamp is specified, it uses the current local time. |
is_associative |
optional 。 Specifies whether to return an array of associations or indexes. If set to False, the array returned is an indexed array. If set to true and then return array is associative array. The associative array of the key is: [Tm_sec]-sec [t m_min]-min [t m _hour]-Hours [TM _ mday]-the first day of one months [tm_ m on]-one months a year (1 = 0) [Tm_year]-life expectancy from 1 900 years Since [t M_wday]-day of the week (Sunday =0) [T M _yday]-Day of the Year [TM _ isdst]-is the effect of daylight saving time |
Array
(
[0] =>
[1] => [
2] =>
[3] =>
[4] => 0
[5] => (
6) => 3
[7] =>
[8] => 0
)
Array
(
[tm_sec] => [
tm_min] => [
tm_hour] =>
[tm_mday] =>
[tm_ Mon] => 0
[tm_year] => [
tm_wday] => 3
[tm_yday] =>
[TM_ISDST] => 0
)