URL to your eFiction: http://www.afislash.com/index.php
Version of eFiction: 3.5.3
Have you bridged eFiction, if so with what?: No
Version of PHP: 5.3.6
Version of MySQL: 5.0.92-community
Have you searched for your problem: Yes
If so, what terms did you try: "timezone settings" "It is not safe" "Warning: date()"
State the nature of your problem: The site is showing an error message that varies slightly depending on the page. Here are a few examples:
Warning: date() [function.date]: 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 'America/Chicago' for 'CDT/-5.0/DST' instead in /home/xine/public_html/blocks/news/news.php on line 49
Warning: date() [function.date]: 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 'America/Chicago' for 'CDT/-5.0/DST' instead in /home/xine/public_html/includes/storyblock.php on line 96
Warning: date() [function.date]: 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 'America/Chicago' for 'CDT/-5.0/DST' instead in /home/xine/public_html/user/profile.php on line 39
This message started showing last night. I'd greatly appreciate any help. Thank you!
Do you have a test account for us? Yes, please PM me for login info.
I'm seeing some chatter about problems with the date() function and PHP version 5.3.6. From the messages it looks like the problem is that there is no default time zone set. It's probably an easy fix (setting the time zone - so far as I'm aware eFiction doesn't do this). If you have access to changing your INI file, see this: http://us2.php.net/manual/en/datetime.configuration.php#ini.date.timezone. Elsewise you can try date_default_timezone_set(), but since it would have to in one of the core files (to be available across all pages using date()), I'm hesitant to give any further instruction since I don't have a 5.3.6 test environment.
Oh wow - I added date.timezone = "America/New_York" to the php.ini file and it fixed the problem.
Thanks so much, I really appreciate the help!
Glad to hear that worked! Do you happen to know if your host had just upgraded your PHP? I suspect that's probably why it suddenly started happening, and will probably continue to affect others as their hosts upgrade.
I just got this too after moving to a new server. (Presumably with a newer version of PHP.) My php.ini was configured correctly, though. I put the following into includes/corefiles.php to make it stop being so annoying.
date_default_timezone_set('America/Los_Angeles');
Naturally you can replace America/Los_Angeles with your timezone of choice: http://php.net/manual/en/timezones.php
It should go after the following I'm guessing.
if(!defined("_CHARSET")) exit( );
It should go in corefiles.php because of all the files that are included in all the others (corefiles.php is included in header.php) it's the place that makes the most sense. But IMPORTANT be careful. Screwing stuff up in corefiles.php is not something you want to do for the same reason.
FYI This is necessary because the way date/time was handled changed in PHP 5.1.2. In 5.3, if you don't follow the new rules then you get E_WARNING messages. So if you're on an earlier version it won't be a problem for you.
