PHP DateTime throws timezone warning even though date.timezone set

PHP

I am constantly getting the following error :

DateTime::createFromFormat(): 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

Although I've specified the DateTime settings in my php.ini like this:

date.timezone = Asia/Jakarta

Any idea?

Best Answer

You're just missing some quotes.

date.timezone = "Asia/Jakarta"

Best of luck!

It could also be that you are not loading the correct php.ini file. See this post for more info: php5.3.3 date.timezone again php.ini directive not taken into account

Related Topic