`[Exception] DateTime::__construct(): `It is not safe to rely on the system's timezone settings

kemal picture kemal · Jul 16, 2013 · Viewed 28.4k times · Source

I 'm using codeception (bdd) making test but gives error

[Exception]                                                                                                
  DateTime::__construct(): 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 Europe/Helsinki for EEST/3.0/DST instead ;

can i do?

Answer

YahyaE picture YahyaE · Jul 16, 2013

You can use date_default_timezone_set('Europe/Istanbul'); before running this code.

For other timezones, check PHP Timezones