“date(): It is not safe to rely on the system's timezone settings…”

前端 未结 24 2259
予麋鹿
予麋鹿 2020-11-22 11:06

I got this error when I requested to update the PHP version from 5.2.17 to PHP 5.3.21 on the server.

24条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-22 11:38

    If you cannot modify your php.ini configuration, you could as well use the following snippet at the beginning of your code:

    date_default_timezone_set('Africa/Lagos');//or change to whatever timezone you want
    

    The list of timezones can be found at http://www.php.net/manual/en/timezones.php.

提交回复
热议问题