(PHP 4, PHP 5, PHP 7)
localtime — 取锟矫憋拷锟斤拷时锟斤拷
$timestamp
= time()
[, bool $is_associative
= false
]] ) : arraylocaltime() 锟斤拷锟斤拷锟斤拷锟斤拷一锟斤拷锟斤拷锟介,锟斤拷峁癸拷锟� C 锟斤拷锟斤拷锟斤拷锟矫凤拷锟截碉拷锟斤拷全一锟斤拷锟斤拷
timestamp
锟斤拷选锟斤拷 timestamp
锟斤拷锟斤拷锟斤拷一锟斤拷 integer 锟斤拷 Unix
时锟斤拷锟斤拷锟斤拷锟轿粗革拷锟斤拷锟斤拷锟斤拷锟街的拷锟轿拷锟角帮拷锟斤拷锟绞憋拷洹R诧拷锟斤拷锟剿碉拷锟斤拷锟街的拷锟轿�
time() 锟侥凤拷锟斤拷值锟斤拷
is_associative
锟斤拷锟斤拷锟轿� FALSE
锟斤拷未锟结供锟津返回碉拷锟斤拷锟斤拷通锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟介。锟斤拷锟斤拷貌锟斤拷锟斤拷锟轿� TRUE
锟斤拷
localtime() 锟斤拷锟斤拷锟斤拷锟截帮拷锟斤拷锟斤拷锟斤拷锟叫达拷
C 锟斤拷 localtime 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟截的诧拷同锟斤拷元锟侥癸拷锟斤拷锟斤拷锟介。锟斤拷锟斤拷锟斤拷锟斤拷锟叫诧拷同锟侥硷拷锟斤拷为锟斤拷
锟斤拷每 锟轿碉拷锟斤拷锟斤拷锟斤拷/时锟戒函锟斤拷时锟斤拷锟斤拷锟绞憋拷锟斤拷锟叫э拷锟斤拷锟斤拷锟斤拷 E_NOTICE
锟斤拷锟斤拷锟斤拷锟绞癸拷锟较低筹拷瓒ㄖ碉拷锟� TZ
锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟� E_STRICT
锟斤拷 E_WARNING
锟斤拷息锟斤拷锟轿硷拷
date_default_timezone_set()锟斤拷
锟芥本 | 说锟斤拷 |
---|---|
5.1.0 |
锟斤拷锟节凤拷锟斤拷 |
Example #1 localtime() 锟斤拷锟斤拷
<?php
$localtime = localtime();
$localtime_assoc = localtime(time(), true);
print_r($localtime);
print_r($localtime_assoc);
?>
锟斤拷锟斤拷锟斤拷锟教碉拷锟斤拷锟斤拷锟斤拷锟斤拷冢锟�
Array ( [0] => 24 [1] => 3 [2] => 19 [3] => 3 [4] => 3 [5] => 105 [6] => 0 [7] => 92 [8] => 1 ) Array ( [tm_sec] => 24 [tm_min] => 3 [tm_hour] => 19 [tm_mday] => 3 [tm_mon] => 3 [tm_year] => 105 [tm_wday] => 0 [tm_yday] => 92 [tm_isdst] => 1 )