![PHP Warning: strtotime(): It is not safe to rely on the system's timezone settings. PHP Warning: strtotime(): It is not safe to rely on the system's timezone settings.](https://image.shishitao.com:8440/aHR0cHM6Ly9ia3FzaW1nLmlrYWZhbi5jb20vdXBsb2FkL2NoYXRncHQtcy5wbmc%2FIQ%3D%3D.png?!?w=700&webp=1)
有三种解决办法:
1. php文件中设置时区
<?php
date_default_timezone_set('Asia/Shanghai');
echo strtotime('2012-9-3');
?>
2. 设置php.ini
data.timezone = "Asia/Shanghai"
3. 设置date_timezone.ini
date.timezone = "Asia/Shanghai"
如果使用zend server ,在 Server Setup -> Directives -> date.timezone 设置成Asia/Shanghai 。
然后点击Save Changes, Restart PHP
对应的时区参考:timezones