Forums / General Questions / Admin showing ADMIN_NAV_DATE_TIME_FORMAT instead of actual time/date

Admin showing ADMIN_NAV_DATE_TIME_FORMAT instead of actual time/date

Views: 1,070

Results 1 to 4 of 4
24 Jan 2016, 1:29 AM
#1
ted_grapler avatar

ted_grapler

New Zenner

Join Date:
Nov 2015
Location:
New Jersey USA
Posts:
76
Plugin Contributions:
0

Admin showing ADMIN_NAV_DATE_TIME_FORMAT instead of actual time/date

Have a 1.5.4 site on shared Linux hosting that is showing the following text in the Admin header: "ADMIN_NAV_DATE_TIME_FORMAT +0000 GMT [xx.xxx.85.103] my.hostingcompany.com - UTC - en_US"

Another Zen Cart 1.5.4 install on the same server does show date/time in Admin header but is about 6 hours different than my local time:

"Sunday 24 Jan 2016 01:16:29 AM +0000 GMT [xx.xx.85.103] my.hostingcompany.com - UTC - en_US"

Two questions- how can I get the one cart to show date/time in Admin and also how to adjust time so it shows my local New York time.

I found this in myadmin/includes/header.php with Developers Tool kit search but don't know if/or how to make changes:

Line #232 : echo ((strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') ? iconv('ISO-8859-1', 'UTF-8', strftime(ADMIN_NAV_DATE_TIME_FORMAT, time())) : strftime(ADMIN_NAV_DATE_TIME_FORMAT, time())); //windows does not "do" UTF-8...so a manual conversion is necessary

Thanks, Ted

24 Jan 2016, 3:56 AM
#2
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Admin showing ADMIN_NAV_DATE_TIME_FORMAT instead of actual time/date

So in the one store with all caps showing, that store is missing the language define to substitute for the constant...

In both stores it looks like the timezone data hasn't been populated... Normally this is controlled/entered in your php.ini. But there is a file in: includes/extra_configures/ called set_time_zone.php

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

25 Jan 2016, 1:40 AM
#3
ted_grapler avatar

ted_grapler

New Zenner

Join Date:
Nov 2015
Location:
New Jersey USA
Posts:
76
Plugin Contributions:
0

Re: Admin showing ADMIN_NAV_DATE_TIME_FORMAT instead of actual time/date

Thanks mc12345678. Turns out there was apparently a missing line in my_admin/includes/languages/english.php I copied Line #28 from the working install and pasted in:

Line #28 : define('ADMIN_NAV_DATE_TIME_FORMAT', '%A %d %b %Y %X'); // this is used for strftime()

Now time/date is showing up in Admin header.

Then in includes/extra_configures/set_time_zone.php I changed to this: Line #14 : $TZ = 'America/New_York'; This corrected the time offset.

Thanks, Ted

25 Jan 2016, 4:51 AM
#4
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Admin showing ADMIN_NAV_DATE_TIME_FORMAT instead of actual time/date

Glad you figured it out. Wasn't sure if I would have to explain how to find what and where the definition should be considering you had one "working" the other "not" :)

Glad that also able to set/correct the time...

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...