解决PHPstudy本地测试strtotime(): It is not safe to rely on the system’s timezone settings错误方法

每天收藏分享主题如果都用主机操作工作量和代价太高,所以一般我都是在本地测试,我最喜欢用的工具是PHPstudy,不过因为昨天重新装了系统,又装了个影子系统,所以不管做什么操作重启一次就会全部复原。今天在测试一款emlog主题时就出现了一个错误。

错误代码

Warning: strtotime(): It is not safe to rely on the system's timezone settings. 
You are *required* to use the date.timezone setting or the date_default_timezone_set() 
function. In case you used any of those methods and you are still getting this warning, 
you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, 
but please set date.timezone to select your timezone. 
in D:\phpStudy\WWW\em\content\templates\emedia_better\index.php on line 31

这是因为PHPstudy环境默认的php.ini对时期的设置问题,修改一下php.ini的时区设置问题就可以解决了,首先打开PHPstudy的php.ini文件;

搜索date.timezone,修改为date.timezone = PRC

默认代码:

;date.timezone

修改后

date.timezone = PRC