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

前端 未结 7 1789
旧时难觅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条回答
  •  旧时难觅i
    2020-11-27 13:31

    The current accepted answer by crack is deprecated in Symfony 2.3 and will be removed by 3.0. It should be moved to the constructor:

    public function __construct($environment, $debug) {
        date_default_timezone_set('Europe/Warsaw');
        parent::__construct($environment, $debug);
    }
    

提交回复
热议问题