我有一个奇怪的问题:
phpinfo()
函数返回 美国/纽约 由于 Plesk 显示 America/New_York 但 centOS 没有显示,Techsupport 对
/usr/share/zoneinfo/
文件,因为他们说 New_York 文件以某种方式显示 MST(山地时间)。该操作后,centOS 时间和
phpinfo()
正确显示 EST 但日期功能仍显示 MST。有任何想法吗?
最佳答案
你试过了吗date_default_timezone_set()
?
Since PHP 5.1.0 (when the date/time functions were rewritten), every call to a date/time function will generate a E_NOTICE if the timezone isn't valid, and/or a E_WARNING message if using the system settings or the TZ environment variable.
关于timezone - php 5.2.17 date ('T' ) 给出的时区不正确。服务器时间+phpinfo时间正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13703116/