Re: Time Zone Fix Support Thread
Quote:
Originally Posted by
gilby
Not quite. See post 52
You need to include the same file in 2 places (edited for your time zone)
One for the ADMIN
YOUR_RENAMED_ADMIN\extra_configures\time_zone_fix.php
and one for the CATALOG (Store Front)
includes\extra_configures\time_zone_fix.php
I have officially been zenned.
Thank you X 10000000....
I had initially changed my timezone in php.ini, and that fixed my timezone issues only in my admin area but kept giving me wrong time stamps on orders.
Next I added the recommended timezonefix file to includes/extraconfigurations and that fixed my order time stamp, but my order update times where still messing up and I really did not know what to do.
After reading your comment just now, I uploaded the file also to myadmin/includes/extraconfigurations and voia! It works, my order update times are now correct.
Thanks you guys for sharing the knowledge.
Re: Time Zone Fix Support Thread
Zencart 1.5.1 - since the plugin only goes to 1.3.9, I started to manually make the changes. I see in the query factory on 1.5.1, the following:
Code:
if (getenv('TZ') && !defined('DISABLE_MYSQL_TZ_SET')) @mysql_query("SET time_zone = '" . substr_replace(date("O"),":",-2,0) . "'", $this->link);
But, I don't see where the TZ environment variable is set.
I already set the timezone for PHP 5.2 using the php.ini file.
Is there a recommended way to set the TZ variable through zencart, or should I simply copy over the time_zone_fix.php files from your 1.3.9 plugin?
Re: Time Zone Fix Support Thread
Quote:
Originally Posted by
carlvt88
Zencart 1.5.1 - since the plugin only goes to 1.3.9, I started to manually make the changes. I see in the query factory on 1.5.1, the following:
Code:
if (getenv('TZ') && !defined('DISABLE_MYSQL_TZ_SET')) @mysql_query("SET time_zone = '" . substr_replace(date("O"),":",-2,0) . "'", $this->link);
But, I don't see where the TZ environment variable is set.
I already set the timezone for PHP 5.2 using the php.ini file.
Is there a recommended way to set the TZ variable through zencart, or should I simply copy over the time_zone_fix.php files from your 1.3.9 plugin?
Starting with Zen Cart v1.5.0, this plugin's operation is part of the core-code. You just need to create a file named time_zone_offset.php and place this file (same file) in two locations:
- /includes/extra_configures/time_zone_offset.php
- /YOUR_ADMIN/includes/extra_configures/time_zone_offset.php
The file will look similar to:
Code:
<?php
// Full list of timezones here: http://php.net/manual/en/timezones.php
//
// You can modify the TZ (Time Zone) by using a named Country/City
// eg:
// TZ=America/Los_Angeles
// TZ=America/Denver;
// TZ=America/Chicago
// TZ=America/Costa_Rica;
putenv ('TZ=America/New_York');
The link to the php.net site contains a list of all the valid TZ environment variable values.
Re: Time Zone Fix Support Thread
Hi can the file 'includes\classes\db\mysql\query_factory.php' be used in version 1.5.1 as it over writes the existing version file?
Re: Time Zone Fix Support Thread
Quote:
Originally Posted by
oavs
Hi can the file 'includes\classes\db\mysql\query_factory.php' be used in version 1.5.1 as it over writes the existing version file?
NO, This part of the code is already in the 1.5 series and is NOT needed. DON'T over write this file.
2 files from this mod are needed. See Post# 63
Re: Time Zone Fix Support Thread
Scenario: ZC shop located in Pacific TZ.
ZC 1.37 shop hosted on a server in Central TZ, running PHP 5.4.15 with the ZC 'Time Zone Offset' mod installed, and -2 offset set under Admin > Config > My Store. Everything seemed good.
Sometime after payment module callbacks and the admin header began showing a two hour difference. Just let it go as it was not a bid deal. Shop order status updates and customer emails went out with proper time stamps.
Then installed fresh clean zc 1.51 on the same server for testing and noted everything in admin showed up as 0 GMT (eight hours ahead). Setting Admin > Config >MyStore to a -8 offset appeared to did nothing.
Then account was moved to a new server, still in the Central TZ, but with PHP 5.4.20. But same issue observed.
So followed Time Zone Fix readme instructions (and instructions in this thread) for ZC 1.51, editing the two time_zone_offset.php files (for the Pacific TZ), and uploading to the catalog and admin side.
Code:
putenv ('TZ=America/Los_Angeles');
But everything in admin still shows up as 0 GMT.
I don't have access to php.ini, but I requested the host to edit for Pacific TZ environment variable. Everything in admin still shows up 0 GMT. However began to observe errors similar to the following in server error log:
Code:
PHP Warning: strtotime(): 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 the timezone 'UTC' for now, but please set date.timezone to select your timezone.
Just requested the webhost to double check the php.ini change to see if spelling is correct. But from the error message above, it appears the ecommerce app should be managing the time zone, not letting the "system" do so.
Not sure why unable to configure ZC 1.51 for the proper TZ, where I was able to do so in ZC 1.37 (for awhile anyway).
Does the issue possibly have anything to do with the PHP version?.
P.S. What exactly dos the Time Off set entry in Admin > Config > My Store suppose to do? Is that part of core, or is that a leftover mod remnant still in the database?
Re: Time Zone Fix Support Thread
Well, I was wrong. Web host said he didn't alter the php.ini for the current running version og php (5.4.20 native). Stated he set up PHP 5.5 with a customized time zone, and wanted me to test using the PHP switcher in ControlPanel. But I repeated that ZC 1.51 is not supported on PHP 5.5
http://www.zen-cart.com/content.php?...o-run-zen-cart
So with ZC 1.52 slated to support PHP 5.5, i think I will just wait to work on solving all these PHP flags showing up in my debug, and various error logs. Hope to see 1.52 sooner than later.
Re: Time Zone Fix Support Thread
Solved... i missed seeing the ZC date.timezone patch patch released in June.
http://www.zen-cart.com/showthread.p...HP-5-3-5-4-5-5
No need then for the Time Zone Fix (time_zone_offset.php)
Re: Time Zone Fix Support Thread
Quote:
Originally Posted by
Woodymon
Not Necessarily....
This will "fix" the php time zone.
You may still need the TZ variables to "fix" the mysql date and time stamps
Re: Time Zone Fix Support Thread
Quote:
Originally Posted by
gilby
Not Necessarily....
This will "fix" the php time zone.
You may still need the TZ variables to "fix" the mysql date and time stamps
Thanks, meant to put a ? mark at end of my last sentence. So in my admin orders page Paypal is showing the correct Pacific time in it's time stamps, but the Zen Cart comment entries shows two hours ahead (Central time) for its time stamps. And so I uploaded the time-zone_fix.php in the two respective directories
putenv ('TZ=America/Los_Angeles');
but still see the timestamps in admin -> orders off by two hours.
Two questions:
1. What does the Time Zone Offset entry in Admin >Config > MyStore suppose to do? Is that a stock zc 1.51 configuration entry? Or something leftover in the database from a previous time zone offset mod install (upgraded the zc db from 1.37 to 1.51)?
I entered "-2" in the form but appears to not be doing anything. Within phpmyadmin I don't see any function associated with that entry in the configuration table.
2. query_factory.php Line 71 shows the following code. What is the function of "-2" in that line? Is that a hardcoded offset? Pretty certain this is the stock zc1.51 file.
Code:
if (getenv('TZ') && !defined('DISABLE_MYSQL_TZ_SET')) @mysql_query("SET time_zone = '" . substr_replace(date("O"),":",-2,0) . "'", $this->link);