PDA

View Full Version : Date/Time Zone warning after upgrade from VB3


MaXimus
03-28-2014, 02:27 AM
I am getting this message:

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable 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 'America/Chicago' for 'CDT/-5.0/DST' instead in ..../includes/functions.php on line 4918

What I had to do is to disable warnings for now.

I did a bit of search online about this problem but didn't understand what I need to do or how to do it: http://php.net/manual/en/function.date-default-timezone-set.php

Please help me with a step by step instructions on how to resolve this issue

I am in Dubai, so the Time Zone is +4 GMT:

+32400|Abu Dhabi, Baku, Kabul, Tehran, Tbilisi, Volgograd GMT+4

ozzy47
03-28-2014, 02:39 AM
This is a server configuration issue and should be set at the server level in the php.ini file. However you can override the issue by setting a locale in your config.php file.

See: http://php.net/manual/en/function.da...mezone-set.php

You would use something like:

date_default_timezone_set ('America/Los_Angeles');

You can find all timezones here: http://www.php.net/manual/en/timezones.php

Really should be set in the php.ini file in this section of code:

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = "America/Los_Angeles"

; http://php.net/date.default-latitude
date.default_latitude = 34.3981

; http://php.net/date.default-longitude
date.default_longitude = 118.1358

; http://php.net/date.sunrise-zenith
;date.sunrise_zenith = 90.583333

; http://php.net/date.sunset-zenith
;date.sunset_zenith = 90.583333

Turning display errors off would also eliminate the problem. They aren't errors, simply warnings. They are due to how PHP has changed over the years. Previous to vBulletin 4.2.2, they were suppressed because vBulletin didn't know how to deal with them.

MaXimus
03-28-2014, 12:58 PM
thanks a lot man. thanks to your advice, I contacted my host (hostgator) and they quickly fixed the issue for meh

ozzy47
03-28-2014, 06:45 PM
Excellent, glad to hear. :)