Some people have reported that the above approach did not work satisfactorily for them.
So here's an alternative:
A. If you're already using ZC v1.5.2 or newer, the following IS ALREADY BUILT-IN! So skip step B here, and go to the instructions in C below.
B. Delete the 2 files from the previous post above, and create the following 2 files instead:
1. /admin/includes/extra_configures/use_catalog_time_zone.php
Code:
<?php
/**
* @package admin
* @copyright Copyright 2003-2013 Zen Cart Development Team
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version GIT: $Id: Author: DrByte Sat Nov 2 01:21:28 2013 -0400 New in v1.5.2 $
*/
// get time zone settings from catalog-side file
include (DIR_FS_CATALOG . '/includes/extra_configures/set_time_zone.php');
2. /includes/extra_configures/set_time_zone.php
Code:
<?php
/**
* @package initSystem
* @copyright Copyright 2003-2013 Zen Cart Development Team
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version GIT: $Id: Author: DrByte Sat Nov 2 01:21:28 2013 -0400 New in v1.5.2 $
*/
/*
* Set time zone
*/
if (version_compare(PHP_VERSION, 5.3, '>='))
{
// put your timezone here. Refer to http://www.php.net/manual/en/timezones.php
$TZ = ''; // eg: 'Europe/Oslo'
/**
* MAKE NO CHANGES BELOW THIS LINE
*
* The following will take the timezone you specified above and apply it in your store.
* If you didn't specify one, it will try to use the setting from your server's PHP configuration
*/
if ($TZ == '') {
$TZ = date_default_timezone_get();
}
if ($TZ != '') {
putenv('TZ=' . $TZ);
@date_default_timezone_set($TZ);
}
}
The line highlighted in red is described below:
C. To set your store to use the correct timezone, simply edit the line shown in red above (in set_time_zone.php), to reflect your desired timezone.
If you're using a Zen Cart version older than v1.5.4, it's time to upgrade!
Bookmarks