Symfony2 and date_default_timezone_get() - It is not safe to rely on the system's timezone settings

前端 未结 7 1745
旧时难觅i
旧时难觅i 2020-11-27 12:43

I have a Symfony2 project. I updated my php to 5.5.7 today and since then, I am getting the

Warning: date_default_timezone_get(): It is not safe to rely on          


        
7条回答
  •  时光取名叫无心
    2020-11-27 13:41

    Following up on sas's answer, PHP 5.4, Symfony 2.8, I had to use

    ini_set('date.timezone','');
    

    instead of date_default_timezone_set. I also added a call to ini_set to the top of a custom web/config.php to get that check to succeed.

提交回复
热议问题