The related setting is to modify the Date.timezone parameter in php.ini:
[Date]
; Defines the default timezone used by the date functions
;d Ate.timezone =
The default is off, just remove the comment, you can
[Date]
; Defines the default timezone used by the date functions
Date.timezone = PRC
Where PRC is the "People's Republic"!
Other options refer to the PHP manual.
However, the above-mentioned Asian region has missed our capital Beijing, do not know that foreigners are not intentional!
If you do not have permission to modify php.ini, you only need to call the time-date function when calling Date_default_timezone_set ('
PRC ')!
You can also call Date_default_timezone_get () to view the current time zone settings!
For XXX, the values available in the mainland are:
Asia/chongqing, Asia/shanghai, Asia/urumqi (Chongqing, Shanghai, Ukraine)
Available in Hong Kong and Taiwan: Asia/macao, Asia/hong_kong, Asia/taipei (Macau, Hongkong, Taipei)
Taiwan area can be set as: Date.timezone = "Asia//taipei"
and Singapore: Asia/singapore
Eight-hour solution for time difference in PHP5
After installing the PHP5, in the forum inadvertently, on the forum to see someone said php5.1.2 time shows a whole less than 8 hours,
echo Date ("y-m-d h:i:s");
?>
As a result, the test itself was 8 hours apart.
Later after the forum to find information, the results are finally resolved, in PHP5 and from the above version, to export the local time (limited to China)
, you can write code like this:
Date_default_timezone_set (' Asia/shanghai ');
echo Date (' y-m-d h:i:s ');
?>
You can also write code like this:
Date_default_timezone_set (' asia/chongqing ');
echo Date (' y-m-d h:i:s ');
?>
This time difference eight hours the problem is solved!! ~~~
http://www.bkjia.com/PHPjc/319250.html www.bkjia.com true http://www.bkjia.com/PHPjc/319250.html techarticle The related setting is to modify the Date.timezone parameter in php.ini: [Date];D efinesthedefaulttimezoneusedbythedatefunctions;d ate.timezone= The default is off, just remove the comment, instead of ...