If this is your first visit, check our documentation. To post, register or login.
Forums / General Questions / General Questions / date/time errors in certain .php files

date/time errors in certain .php files

Started by tpeck on 8 Apr 2013, 4:34 AM · Views: 505

Results 1 to 2 of 2
8 Apr 2013, 4:34 AM
#1
tpeck avatar

tpeck

Zen Follower

Join Date:
Oct 2008
Posts:
197
Plugin Contributions:
0

Post #1 by tpeck

I am getting a lot of date/time errors in the domain log;

[Sun Apr 07 22:32:35 2013] [error] [client 173.199.114.243] PHP Warning: date() [<a href='function.date'>function.date</a>]: 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/aap/public_html/zencart/includes/languages/english/email_extras.php on line 30

They refer to entries like $date_range = time(); on the php pages.

Is there a one-stop solution somewhere - a checkbox or something - that fixes things?

8 Apr 2013, 4:40 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #2 by drbyte

tpeck:

Is there a one-stop solution somewhere - a checkbox or something - that fixes things?
Yes.
It's in the log message you quoted:
tpeck:

You are required to use the date.timezone setting or the date_default_timezone_set() function.
Go to your server's php.ini and set date.timezone to a valid timezone.
If you don't have access to that file, get your hosting company to assist you or to show you how to set one up for your account specifically.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.