![]() |
Crazy Error... Fix it?
ERROR MESSAGE: 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/Denver' for 'MST/-7.0/no DST' instead
How do I fix that? Like, server setting-wise. (if thats the problem) |
Can we see the code please?
|
[php]
<?php date(); ?> |
Sounds like it's an issue with the date.timezone setting in your php.ini config file. In PHP 5 you can set this prior to using date() (as mentioned in the error message) with date_default_timezone_set() function.
Your code is still incorrect, however. You haven't passed a formatting parameter to date(). |
Did you or the server change anything about the timestamp (Apoch 1970)? If so, reset it. This is a totally not common error.
|
1 Attachment(s)
Infact it is a very common error :-) PHP5 requires you to set the default timezone before using any date functions.
If you are unable to do this in your php.ini file, then you can use date_default_timezone_set() as Sock mentioned. Example: PHP Code:
List of supported timezones: PHP: List of Supported Timezones - Manual And finally, attached is a PHP file with all the above timezones in an array. I use it to generate a <select> dropdown list to let the users set their own timezone. Alan |
Awesome, another thing I didn't know. Thanks Alan
|
| All times are GMT. The time now is 01:24 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0