Php 5.3.0 & TomatoCart (The online store stop working due to the wrong system’s timezone)

After upgrading webservers to new stable 5.3.0, tomatocart started to give following errors to every page:

[09-Aug-2012 10:09:53] PHP 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 ‘Asia/Jerusalem’ for ‘IDT/3.0/DST’ instead in /home/gadgetsc/domains/gadgets-car.com/public_html/templates/glass_gray/index.php on line 281

Since PHP 5.1.0 (when the date/time functions were rewritten), every call to a date/time function will generate a E_NOTICE if the timezone isn’t valid, and/or a E_WARNING message if using the system settings or the TZ environment variable.

This is not a TomatoCart issue. It’s a PHP configuration issue which is triggered when the very simple common “date()” function is called within PHP. If you fix your timezone settings in your PHP configuration, the problem should go away.

There are two approaches to to let php know what your time zone is:

  1. You can edit your php.ini file and put in the following line as date.timezone = “America/Anchorage”. Please find your valid time zone at You can find valid time zone strings at http://www.php.net/manual/en/timezones.php
  2. If you don’t have access to the php.ini, adding your time zone string to the top of application_top.php located in the includes directory. It will do much the same thing:date_default_timezone_set(‘America/Chicago’);Use whatever timezone is appropriate for you, of course. List is here:

    http://www.php.net/manual/en/timezones.php

In the version 1.1.8, TomatoCart will add a timezone setting under Configuration->Configuration->My Store in the admin panel. In this case, if necessary, the user just need to set it in the admin panel.

Figure 1. TimeZone Setting under Configuraion->My Store

If the php version on your web server is greater than 5.3.0, please fix the issue about the time zone as above.

Tags: , , | Posted under TomatoCart | RSS 2.0

Author Spotlight

Jack Yin

Jack Yin

TomatoCart Developer & Co Founder - Arvixe Web Hosting / TomatoCart Community Liaison

Leave a Reply

Your email address will not be published. Required fields are marked *


4 + = 8

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>