Zen Cart Logo
Forums / Basic Configuration / Admin date & time in UK format

Admin date & time in UK format

Locked

Views: 4,569

Results 1 to 15 of 15
This thread is locked. New replies are disabled.
15 Jan 2008, 8:33 PM
#1
styrax avatar

styrax

New Zenner

Join Date:
Jun 2006
Location:
Manchester, UK
Posts:
38
Plugin Contributions:
0

Admin date & time in UK format

I'm attempting to set the date and time on my Admin page to display in my local time (GMT).

I've amended the admin/includes/languages/english.php to this:

// look in your $PATH_LOCALE/locale directory for available locales..
// on RedHat6.0 I used 'en_US'
// on FreeBSD 4.0 I use 'en_US.ISO_8859-1'
// this may not work under win32 environments..
setlocale(LC_TIME, 'en_GB.ISO_8859-1');
define('DATE_FORMAT_SHORT', '%d/%m/%Y'); // this is used for strftime()
define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime()
define('DATE_FORMAT', 'd/m/Y'); // this is used for date()
define('PHP_DATE_TIME_FORMAT', 'd/m/Y H:i:s'); // this is used for date()
define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');
define('DATE_FORMAT_SPIFFYCAL', 'dd/MM/yyyy'); //Use only 'dd', 'MM' and 'yyyy' here in any order

which sets the display of date/month in the UK format in my Admin lists, but it doesn't alter the time displayed (it shows as GMT - 6 hours). Is there something up with my syntax, or am I altering the wrong thing?

Thanks in anticipation.

Phil

15 Jan 2008, 8:49 PM
#2
superprg avatar

superprg

Totally Zenned

Join Date:
Feb 2006
Location:
Chicago
Posts:
1,349
Plugin Contributions:
0

Re: Admin date & time in UK format

Hi Phil
Just for the experiment sake
Can you test putting
setlocale(LC_TIME, "fra_fra");
and verify if you see any difference in the output?
Thanks

15 Jan 2008, 9:06 PM
#3
styrax avatar

styrax

New Zenner

Join Date:
Jun 2006
Location:
Manchester, UK
Posts:
38
Plugin Contributions:
0

Re: Admin date & time in UK format

Thanks for that.

I've altered it to 'fra_fra' (with single quotes as here) but the time still displays as GMT - 6 hours.

Regards

Phil

15 Jan 2008, 9:14 PM
#4
superprg avatar

superprg

Totally Zenned

Join Date:
Feb 2006
Location:
Chicago
Posts:
1,349
Plugin Contributions:
0

Re: Admin date & time in UK format

I can see that setlocale not working on this server
Who is your host? What os of the server
Not sure but see if this helps from the link

http://us.php.net/setlocale

after the upgrade to the new stable (woody), you may have encountered that setlocale is not working at all, even though you have the files in the /usr/share/locale directory and everything was fine before the upgrade. in this case look at the /etc/locale.gen file, which contains the generated locales. if it is empty, you do not have any useful locales. to generate the needed locales run 'dpkg-reconfigure locales' as root and select the locales you need.


15 Jan 2008, 9:26 PM
#5
styrax avatar

styrax

New Zenner

Join Date:
Jun 2006
Location:
Manchester, UK
Posts:
38
Plugin Contributions:
0

Re: Admin date & time in UK format

Hi

my host is running a Linux server.

Is my problem to do with the fact that I'm running WindowsXP?

Regards,

Phil

15 Jan 2008, 9:55 PM
#6
superprg avatar

superprg

Totally Zenned

Join Date:
Feb 2006
Location:
Chicago
Posts:
1,349
Plugin Contributions:
0

Re: Admin date & time in UK format

Client side OS doesnt matters at all
Please ask your host as setlocale doesnt seems to work as expected on the server
Thanks

15 Jan 2008, 10:03 PM
#7
styrax avatar

styrax

New Zenner

Join Date:
Jun 2006
Location:
Manchester, UK
Posts:
38
Plugin Contributions:
0

Re: Admin date & time in UK format

Thanks for the advice.

I will ask my host about this.

Regards

Phil

20 Jan 2008, 4:27 PM
#9
styrax avatar

styrax

New Zenner

Join Date:
Jun 2006
Location:
Manchester, UK
Posts:
38
Plugin Contributions:
0

Re: Admin date & time in UK format

Thanks for the information.

I'm running version 1.3.8 so I don't know if the contribtion you have pointed me to will work since it was last updated to 1.3.7. Has anyone tried it with 1.3.8?

My host is in the USA and I'm in the UK, so it looks as though this is pointing me in the right direction, especially since the host is telling me a) the the server is properly configured and b) none of the other users of the server are reporting an equivalent problem.

Regards, Phil

21 Jan 2008, 11:54 AM
#10
soba avatar

soba

New Zenner

Join Date:
Jan 2008
Location:
EGYPT
Posts:
66
Plugin Contributions:
0

Re: Admin date & time in UK format

dear styrax

it will work fine

mine too host in USA and store in EGYPT and run z1.3.8

try it

21 Jan 2008, 6:08 PM
#11
styrax avatar

styrax

New Zenner

Join Date:
Jun 2006
Location:
Manchester, UK
Posts:
38
Plugin Contributions:
0

Re: Admin date & time in UK format

Thanks Soba

I will give it a try.

Regards

Phil

22 Jan 2008, 3:37 PM
#12
styrax avatar

styrax

New Zenner

Join Date:
Jun 2006
Location:
Manchester, UK
Posts:
38
Plugin Contributions:
0

Re: Admin date & time in UK format

I tried it, but it doesn't work for me!

The MySQL patch uploads fine, but when I overwrite the 1.3.8 files with the ones suggested in this download I just end up crashing my site. My site just comes up a blank screen even though the Admin loads fine.
When I revert to the 1.3.8 core files, the site comes up fine again.

Regards

Phil

25 Jan 2008, 2:28 PM
#13
dml311071 avatar

dml311071

New Zenner

Join Date:
Sep 2006
Location:
Grimsby UK
Posts:
98
Plugin Contributions:
0

Re: Admin date & time in UK format

Two things, one suggestion and one question:

  1. I would always advise users in the UK to have their site hosted in the UK of you are looking to sell in the UK, also I would advise primarily using .co.uk domains in a uk data centre, the jus forward any .com etc to the .co.uk domain.
    This will help your search engine listings in the big G (your data centre will be relevant to your domain) and the server will most likely be set up in such a way as to prevent time/date offset problem from the start.

I imagine that UK users are using US servers because they are incredibly cheap and offer pre-installed Zencart software but I would advise against making this a habit if you are installing ZC regularly.

I don't know if this is relevent for user in other countries, but I would have thought that all of those country based domains are grouped in the Google servers data centres in the same way.

  1. Is there a module that alters all dates to the UK format (dd/mm/yyyy), such as date the product was added, advanced search that sort of thing?

I never did get used to US date format, it causes us the same mind conflict as driving on the right! (well, on a much lesser scale, after all anyone from the UK who has driven in mainland Europe will certainly feel very strange making that first right turn into a right hand lane!)

No flames please, this is just a personal observation!

Regards

Dave

25 Jan 2008, 2:35 PM
#14
dml311071 avatar

dml311071

New Zenner

Join Date:
Sep 2006
Location:
Grimsby UK
Posts:
98
Plugin Contributions:
0

Re: Admin date & time in UK format

Two things, one suggestion and one question:

  1. I would always advise users in the UK to have their site hosted in the UK of you are looking to sell in the UK, also I would advise primarily using .co.uk domains in a uk data centre, the just forward any .com etc to the .co.uk domain.
    This will help your search engine listings in the big G (your data centre will be relevant to your domain) and the server will most likely be set up in such a way as to prevent time/date offset problem from the start.

I imagine that UK users are using US servers because they are incredibly cheap and offer pre-installed Zencart software but I would advise against making this a habit if you are installing ZC regularly.

I don't know if this is relevent for user in other countries, but I would have thought that all of those country based domains are grouped in the Google servers data centres in the same way.

  1. Is there a module that alters all dates to the UK format (dd/mm/yyyy), such as date the product was added, advanced search that sort of thing?

I never did get used to US date format, it causes us the same mind conflict as driving on the right! (well, on a much lesser scale, after all anyone from the UK who has driven in mainland Europe will certainly feel very strange making that first right turn into a right hand lane!)

No flames please, this is just a personal observation!

Regards

Dave

25 Jan 2008, 4:41 PM
#15
styrax avatar

styrax

New Zenner

Join Date:
Jun 2006
Location:
Manchester, UK
Posts:
38
Plugin Contributions:
0

Re: Admin date & time in UK format

Since I installed the time zone offset module mentioned in post 12 I'm now experiencing more serious problems.

The module did not work for me so I went to my back-up files and replaced the core files which had been changed in installing the module. All seemed fine. The site seemed to work fine, both in the Admin and in the public domain.

However, when I tested the 'log-in' and 'checkout' facilities, they fail to redirect to the correct page. I've checked that I've re-installed all the files which were overwritten, and I've deleted the MySQL patch installed from the time zone offset module using phpMyAdmin.

Any ideas on what I should do next?

Not sure if I should have posted this as a new thread. Apologies if this post should be somewhere else.

Regards

Phil