Forums / General Questions / Admin Time Zone/Location Incorrect

Admin Time Zone/Location Incorrect

Results 1 to 17 of 17
21 Jan 2015, 21:30
#1
dave224 avatar

dave224

Zen Follower

Join Date:
Jun 2012
Posts:
481
Plugin Contributions:
0

Admin Time Zone/Location Incorrect

Just installed 1.5.4 fresh version. How and where do I set the store time zone/location that appears in the admin main screen?
Thanks, Dave
21 Jan 2015, 21:31
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

Re: Admin Time Zone/Location Incorrect

/includes/extra_configures/set_time_zone.php
26 Jan 2015, 23:00
#3
hfxracing avatar

hfxracing

New Zenner

Join Date:
May 2011
Posts:
39
Plugin Contributions:
0

Re: Admin Time Zone/Location Incorrect

DrByte:

/includes/extra_configures/set_time_zone.php

is there anything that can prevent this from working Just upgraded from 1.51 to 1.54 time is not working
set it using the above file
customer is hosted at godaddy
If anyone can help that would be awesome
26 Jan 2015, 23:23
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

Re: Admin Time Zone/Location Incorrect

Login to your store Admin.
Click on Tools->Server Info
Press CTRL+F to "search the page" and search for "date.timezone"
That'll show you the whole "date" section.
Paste the whole date section here, along with what you've got in set_catalog_time_zone.php
26 Jan 2015, 23:27
#5
hfxracing avatar

hfxracing

New Zenner

Join Date:
May 2011
Posts:
39
Plugin Contributions:
0

Re: Admin Time Zone/Location Incorrect

[TABLE="width: 700"]
[TR]
[TD="class: e, bgcolor: #CCCCFF"]date/time support[/TD]
[TD="class: v, bgcolor: #CCCCCC"]enabled[/TD]
[/TR]
[TR]
[TD="class: e, bgcolor: #CCCCFF"]"Olson" Timezone Database Version[/TD]
[TD="class: v, bgcolor: #CCCCCC"]2010.9[/TD]
[/TR]
[TR]
[TD="class: e, bgcolor: #CCCCFF"]Timezone Database[/TD]
[TD="class: v, bgcolor: #CCCCCC"]internal[/TD]
[/TR]
[TR]
[TD="class: e, bgcolor: #CCCCFF"]Default timezone[/TD]
[TD="class: v, bgcolor: #CCCCCC"]America/Phoenix[/TD]
[/TR]
[/TABLE]

[TABLE="width: 700"]
[TR="class: h, bgcolor: #9999CC"]
[TH]Directive[/TH]
[TH]Local Value[/TH]
[TH]Master Value[/TH]
[/TR]
[TR]
[TD="class: e, bgcolor: #CCCCFF"]date.default_latitude[/TD]
[TD="class: v, bgcolor: #CCCCCC"]31.7667[/TD]
[TD="class: v, bgcolor: #CCCCCC"]31.7667[/TD]
[/TR]
[TR]
[TD="class: e, bgcolor: #CCCCFF"]date.default_longitude[/TD]
[TD="class: v, bgcolor: #CCCCCC"]35.2333[/TD]
[TD="class: v, bgcolor: #CCCCCC"]35.2333[/TD]
[/TR]
[TR]
[TD="class: e, bgcolor: #CCCCFF"]date.sunrise_zenith[/TD]
[TD="class: v, bgcolor: #CCCCCC"]90.583333[/TD]
[TD="class: v, bgcolor: #CCCCCC"]90.583333[/TD]
[/TR]
[TR]
[TD="class: e, bgcolor: #CCCCFF"]date.sunset_zenith[/TD]
[TD="class: v, bgcolor: #CCCCCC"]90.583333[/TD]
[TD="class: v, bgcolor: #CCCCCC"]90.583333[/TD]
[/TR]
[TR]
[TD="class: e, bgcolor: #CCCCFF"]date.timezone[/TD]
[TD="class: v, bgcolor: #CCCCCC"]America/Phoenix[/TD]
[TD="class: v, bgcolor: #CCCCCC"]America/Phoenix[/TD]
[/TR]
[/TABLE]

Set Catolog Time Zone


<?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 = 'Canada/Atlantic'; // 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);
}
}
26 Jan 2015, 23:42
#6
hfxracing avatar

hfxracing

New Zenner

Join Date:
May 2011
Posts:
39
Plugin Contributions:
0

Re: Admin Time Zone/Location Incorrect

I just found out that he is on PHP 5.2 & that the Blank Admin page fix had to be used after upgrade to get him into the admin. Maybe I should switch him to 5.5 I can change that
27 Jan 2015, 02:00
#8
hfxracing avatar

hfxracing

New Zenner

Join Date:
May 2011
Posts:
39
Plugin Contributions:
0

Re: Admin Time Zone/Location Incorrect

DrByte:

'Canada/Atlantic' is not a valid timezone for PHP according to http://www.php.net/manual/en/timezones.php
Try 'America/Halifax' instead.

Canada/Halifax works fine on my zencart website I will try it
27 Jan 2015, 02:05
#9
hfxracing avatar

hfxracing

New Zenner

Join Date:
May 2011
Posts:
39
Plugin Contributions:
0

Re: Admin Time Zone/Location Incorrect

Nope didn't work
27 Jan 2015, 03:47
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

Re: Admin Time Zone/Location Incorrect

Then something else in your site's PHP files is setting it to Phoenix. (Perhaps you've specified the timezone in another file someplace, and that's overriding this one)

Search for Phoenix using the bottom search in the Developers Toolkit
27 Jan 2015, 15:34
#11
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Posts:
6,263
Plugin Contributions:
3

Re: Admin Time Zone/Location Incorrect

hfxracing:

Nope didn't work


Try this:

Load /admin/includes/application_top.php into a text editor.

Find the code that reads:

---------------------------------------------------
* Get time zone info from PHP config*/
if (version_compare(PHP_VERSION, 5.3, '>='))
{
@date_default_timezone_set(date_default_timezone_get());
}

--------------------------------------------------------

Replace it with:
--------------------------------------------
if (version_compare(PHP_VERSION, 5.3, '>='))
{
@date_default_timezone_set('America/Halifax');
}
------------------------------------------------

Save the file. This *should* take care of the problem for you.

I understand/realise that this isn't an official change/fix (and is incompatible with upgrades), BUT I came across a similar problem a few months ago and after going around in circles trying to find the cause as to why the original code wasn't working I discovered that this change gave an immediate fix (and I never got back to figuring out the true cause of the problem, or why it was only this one site (out of many) that was affected.

Cheers
RodG
09 Mar 2015, 16:02
#12
man_from_mars avatar

man_from_mars

New Zenner

Join Date:
Mar 2015
Posts:
77
Plugin Contributions:
0

Re: Admin Time Zone/Location Incorrect

Hi All

I am new to this forum and new to On-Line Store programming. I have installed Zen Cart 1.5.4 and everything was going well until I tried to log into my admin (newly named) page when I get the error of:
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. in /websites/123reg/LinuxPackage23/xx/xx/xx/xxxxx.net/public_html/xxxxxx/xxxxxx/login.php on line 13

I have searched the Forum and have tried a number of solutions including creating new .php files. to no avail.

In the above error it states to select the correct timezone in the login.php file on line 13, 'but, I can only see the password expiry time (-90days) and I'm not sure if this is relevant. Although it is in lines 13 and 14 in 'set_time_zone.php. So as you can possibly tell I'm getting really confused.

I would like to set the time zone to either Europe/London or GMT, can anyone out-there offer me some assistance.

Look forward from hearing from you earthlings!
09 Mar 2015, 16:24
#13
man_from_mars avatar

man_from_mars

New Zenner

Join Date:
Mar 2015
Posts:
77
Plugin Contributions:
0

Re: Admin Time Zone/Location Incorrect

Thanks

Saw this post before I wrote my question and tried it without any luck. I am using Notepad++ to edit php's, so I guess this isn't the problem. Any other ideas. Why does the login page suggest login.php line 13?
09 Mar 2015, 16:36
#14
man_from_mars avatar

man_from_mars

New Zenner

Join Date:
Mar 2015
Posts:
77
Plugin Contributions:
0

Re: Admin Time Zone/Location Incorrect

Thanks RodG

Saw this post before I wrote my question and tried it without any luck. I am using Notepad++ to edit php's, so I guess this isn't the problem. Any other ideas. Why does the login page suggest login.php line 13?
09 Mar 2015, 16:53
#15
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Posts:
6,263
Plugin Contributions:
3

Re: Admin Time Zone/Location Incorrect

Man from Mars:


Saw this post before I wrote my question and tried it without any luck. I am using Notepad++ to edit php's, so I guess this isn't the problem. Any other ideas. Why does the login page suggest login.php line 13?


From the error log that you posted:
In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier

Is it possible that this is the cause of your problem?

You can ignore the 'login.php line 13' - This is just reporting the line that is calling the function with the error.

Cheers
RodG
09 Mar 2015, 17:17
#16
man_from_mars avatar

man_from_mars

New Zenner

Join Date:
Mar 2015
Posts:
77
Plugin Contributions:
0

Re: Admin Time Zone/Location Incorrect

Can you spell for me then either Europe/London or GMT

Also Where you think I should place this in the line :blush:
10 Mar 2015, 11:00
#17
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Posts:
6,263
Plugin Contributions:
3

Re: Admin Time Zone/Location Incorrect

Man from Mars:

Can you spell for me then either Europe/London or GMT


Sure. It depends on where/how you are setting it though.

date.timezone = "Europe/London"
date_default_timezone_set('Europe/London');

OK, so the spelling is the same in both cases, but as you can see, the *format* is different. Wrong format in wrong place = No go.

Man from Mars:


Also Where you think I should place this in the line :blush:


I think you should use the correct format in whatever place is permitted by your particular server.

Best place "/includes/extra_configures/set_time_zone.php"
Worst place "/application_top.php"

Cheers
RodG