Forums / All Other Contributions/Addons / Time Zone Fix Support Thread

Time Zone Fix Support Thread

Started by gilby on 14 Feb 2011, 11:46 AM · Views: 28,393

Results 1 to 20 of 83
14 Feb 2011, 11:46 AM
#1
gilby avatar

gilby

Totally Zenned

Join Date:
Aug 2005
Location:
Vic, Oz
Posts:
1,816
Plugin Contributions:
0

Time Zone Fix Support Thread

This is the official support thread for this new mod.

This mod is available for download here: Time Zone Fix

This module allows you to set the Server PHP and MySql time zone to your local time zone in your Zen-Cart website, if you are in a situation where your store is in a different time zone from the server on which it is hosted. (For example, your store is based in Australia but is hosted on a server in the USA.)

This module replaces the previous Time Zone Offset mod.
Much simpler and overwrites only 1 core file.
When working it fixes all known Time Zone problems.

17 Feb 2011, 10:10 PM
#2
nigelt74 avatar

nigelt74

Totally Zenned

Join Date:
Sep 2005
Location:
Waikato, New Zealand
Posts:
1,558
Plugin Contributions:
1

Re: Time Zone Fix Support Thread

Cheers Gilby

Works perfectly for me

Thanks

Webzings Design
Semi retired from Web Design

17 Feb 2011, 11:03 PM
#3
gilby avatar

gilby

Totally Zenned

Join Date:
Aug 2005
Location:
Vic, Oz
Posts:
1,816
Plugin Contributions:
0

Re: Time Zone Fix Support Thread

nigelt74:

Cheers Gilby

Works perfectly for me

Thanks

Good to hear.
And, Thanks for testing the beta version for me last year

18 Feb 2011, 4:16 PM
#4
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Time Zone Fix Support Thread

Gilby,

noticed this change from the beta and the new version

Beta Version

        // begin mod to set mysql timezone (gilby)
        if (getenv('TZ')) {
          @mysql_query("SET time_zone = '" . substr_replace(date("O"),":",-2,0) . "'", $this->link);
        }
        // end mod to set mysql timezone (gilby)

New Version

        // begin mod to set mysql timezone (gilby)
          @mysql_query("SET time_zone = '" . substr_replace(date("O"),":",-2,0) . "'", $this->link);
        // end mod to set mysql timezone (gilby)

Will this make any difference to how things work.

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

18 Feb 2011, 11:15 PM
#5
gilby avatar

gilby

Totally Zenned

Join Date:
Aug 2005
Location:
Vic, Oz
Posts:
1,816
Plugin Contributions:
0

Re: Time Zone Fix Support Thread

clydejones:

Gilby,

noticed this change from the beta and the new version

Beta Version

    // begin mod to set mysql timezone (gilby)
    if (getenv('TZ')) {
      @mysql_query("SET time_zone = '" . substr_replace(date("O"),":",-2,0) . "'", $this->link);
    }
    // end mod to set mysql timezone (gilby)
> 
> New Version
> 
> ```php
        // begin mod to set mysql timezone (gilby)
          @mysql_query("SET time_zone = '" . substr_replace(date("O"),":",-2,0) . "'", $this->link);
        // end mod to set mysql timezone (gilby)

Will this make any difference to how things work.

No it won't
The beta version just checked that you had indeed set the TZ variable, hopefully to your local time.

Removing that test still sets the mysql time to be the same as the php time.

I used the TZ variable as it is a backwardly supported way to set the php time.

In future you may in php5.3 set the php time a different way.
If you do then the mysql time will still be updated.

18 Feb 2011, 11:27 PM
#6
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Time Zone Fix Support Thread

gilby:

No it won't
The beta version just checked that you had indeed set the TZ variable, hopefully to your local time.

Removing that test still sets the mysql time to be the same as the php time.

I used the TZ variable as it is a backwardly supported way to set the php time.

In future you may in php5.3 set the php time a different way.
If you do then the mysql time will still be updated.

OK. Many thanks.

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

21 Feb 2011, 12:18 AM
#7
maac2 avatar

maac2

New Zenner

Join Date:
Jan 2011
Posts:
70
Plugin Contributions:
0

Re: Time Zone Fix Support Thread

Hi, just wanted to add my thanks for this mod. An elegant solution and much appreciated.

21 Feb 2011, 1:46 AM
#8
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,735
Plugin Contributions:
56

Re: Time Zone Fix Support Thread

Yep, works like a charm. Thanks for your contribution!

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

11 Mar 2011, 9:38 AM
#9
ellepi avatar

ellepi

New Zenner

Join Date:
Feb 2011
Posts:
2
Plugin Contributions:
0

Re: Time Zone Fix Support Thread

Is very good and easy. Many thanks

16 Mar 2011, 5:59 PM
#10
george_usa avatar

george_usa

New Zenner

Join Date:
Nov 2010
Posts:
37
Plugin Contributions:
0

Re: Time Zone Fix Support Thread

this is straight-forward excellent mod for the timezone fix. :smile:

22 Mar 2011, 4:30 AM
#11
nohart avatar

nohart

Zen Follower

Join Date:
Apr 2010
Posts:
133
Plugin Contributions:
0

Re: Time Zone Fix Support Thread

Hello just a few clarifications...

In my directions it says:

Edit this mods YOUR_RENAMED_ADMIN/includes/extra_configures/time_offset.php

But in my folder structure as above the only file in the extra_configures folder is time_zone_fix.php

So I assume that this is a type error in the directions. I edited the time zone as stated and logged in to my store and sure enough the time is correct!

Now it says:

Copy this same edited file to the front end of your store
includes/extra_configures/time_offset.php

Well what exactly is the "front end" of my store? (Please excuse my ignorance.)

Are you meaning the root directory of my store?

Anyway I have been looking for a mod like this for some time and have been patiently waiting until this came along! Thank you!

22 Mar 2011, 5:16 AM
#12
nigelt74 avatar

nigelt74

Totally Zenned

Join Date:
Sep 2005
Location:
Waikato, New Zealand
Posts:
1,558
Plugin Contributions:
1

Re: Time Zone Fix Support Thread

nohart:

Hello just a few clarifications...

In my directions it says:

Edit this mods YOUR_RENAMED_ADMIN/includes/extra_configures/time_offset.php

But in my folder structure as above the only file in the extra_configures folder is time_zone_fix.php

So I assume that this is a type error in the directions. I edited the time zone as stated and logged in to my store and sure enough the time is correct!

Now it says:

Copy this same edited file to the front end of your store
includes/extra_configures/time_offset.php

Well what exactly is the "front end" of my store? (Please excuse my ignorance.)

Are you meaning the root directory of my store?

Anyway I have been looking for a mod like this for some time and have been patiently waiting until this came along! Thank you!

yep the root of your store

basically yourstore . com/includes/extra_configures/time_offset.php

Webzings Design
Semi retired from Web Design

4 Apr 2011, 5:15 AM
#13
pizza392 avatar

pizza392

New Zenner

Join Date:
Mar 2011
Posts:
76
Plugin Contributions:
0

Re: Time Zone Fix Support Thread

does it work for daylight saving time?
4 times per year (server and location)

4 Apr 2011, 5:36 AM
#14
gilby avatar

gilby

Totally Zenned

Join Date:
Aug 2005
Location:
Vic, Oz
Posts:
1,816
Plugin Contributions:
0

Re: Time Zone Fix Support Thread

pizza392:

does it work for daylight saving time?
4 times per year (server and location)

Your server and php needs to support it first.
And... most do!

This mod works off the servers php time support
If your server and php support it then yes, this mod works fine at those 4 times a year.

5 Apr 2011, 2:17 AM
#15
pizza392 avatar

pizza392

New Zenner

Join Date:
Mar 2011
Posts:
76
Plugin Contributions:
0

Re: Time Zone Fix Support Thread

thank you for your response

i have another question, can i test this mod in my local site? it seems it doesn't work on local site?

5 Apr 2011, 2:38 AM
#16
gilby avatar

gilby

Totally Zenned

Join Date:
Aug 2005
Location:
Vic, Oz
Posts:
1,816
Plugin Contributions:
0

Re: Time Zone Fix Support Thread

pizza392:

thank you for your response

i have another question, can i test this mod in my local site? it seems it doesn't work on local site?

Most local installs don't have this support enabled so it probably won't work correctly on your local install.

3 May 2011, 9:54 AM
#17
bonnit avatar

bonnit

Zen Follower

Join Date:
Jun 2009
Location:
Kent, UK
Posts:
350
Plugin Contributions:
0

Re: Time Zone Fix Support Thread

works great thanks!

however i do have one problem which may or may not be this mod, i am in the uk and have set up this mod as per instructions and can see the correct time in both my admin header, orders and also version page. but on my admin home page my stats counter seems to be counting for tomorrow and also another mod supertracker seems to be off timewise too - my who's online states the correct time.

i have no other mods affectins the mysql query file or of course the time_zone_fix files and none that would need display alternative server times so cannot forsee any mods interfering with this one.

my last entry on supertracker was as follows:

Time Arrived: 05/03/2011 19:48:24
Last Click: 05/03/2011 19:48:24

i am in the uk and it is currently 5/03/2011 10.53 am (so the above is impossible lol)

do you have any suggestions please?

http://www.mods.livvylougifts.co.uk Zen Cart Mod Site
http://www.livvylougifts.co.uk Personalised gifts for every occasion

4 May 2011, 2:27 AM
#18
gilby avatar

gilby

Totally Zenned

Join Date:
Aug 2005
Location:
Vic, Oz
Posts:
1,816
Plugin Contributions:
0

Re: Time Zone Fix Support Thread

bonnit:

works great thanks!

however i do have one problem which may or may not be this mod, i am in the uk and have set up this mod as per instructions and can see the correct time in both my admin header, orders and also version page. but on my admin home page my stats counter seems to be counting for tomorrow and also another mod supertracker seems to be off timewise too - my who's online states the correct time.

i have no other mods affectins the mysql query file or of course the time_zone_fix files and none that would need display alternative server times so cannot forsee any mods interfering with this one.

my last entry on supertracker was as follows:

Time Arrived: 05/03/2011 19:48:24
Last Click: 05/03/2011 19:48:24

i am in the uk and it is currently 5/03/2011 10.53 am (so the above is impossible lol)

do you have any suggestions please?

Make sure you have BOTH
YOUR_RENAMED_ADMIN/includes/extra_configures/time_offset.php
and
includes/extra_configures/time_offset.php

The first sets the PHP time in Admin
The second sets the PHP time in the front end of the website
They should be edited to your timezone and be identical files

Just had a quick look thru Supertracker and cannot see anything that would cause a problem.

So I suspect you may have missed something in the setup

8 May 2011, 11:33 AM
#19
bonnit avatar

bonnit

Zen Follower

Join Date:
Jun 2009
Location:
Kent, UK
Posts:
350
Plugin Contributions:
0

Re: Time Zone Fix Support Thread

i left one of the as australia like a wally, sorry for the hassle, thanks!

http://www.mods.livvylougifts.co.uk Zen Cart Mod Site
http://www.livvylougifts.co.uk Personalised gifts for every occasion

1 Jul 2011, 2:45 AM
#20
andrewnguyen avatar

andrewnguyen

New Zenner

Join Date:
Mar 2011
Location:
VIC, AU
Posts:
64
Plugin Contributions:
2

Re: Time Zone Fix Support Thread

Nice mod gilby. Works perfectly for me.

Cheers!