Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Configuring the Zen Cart Admin / Basic Configuration / Date on "Specials" showing the year 2036

Date on "Specials" showing the year 2036

Locked

Started by frank18 on 15 Dec 2007, 9:11 AM · Views: 2,423

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
15 Dec 2007, 9:11 AM
#1
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Post #1 by frank18

Hi all,

I am a new Zenner, made a lot of changes and modifications to date, all work well except for this one:

have changed the date format in various files to DD/MM/YYYY to conform with Australian standards. All fine until I set start and finish dates to "Specials" and "Featured Products". I use the calendar, click my date, hit save, get back to the listing and the date shows garbage like the year 2036 (may not be alive then .... I am 53 now :huh:).

any ideas what may have gone wrong? :cry:

thanks / Frank

https://www.frnt.org/zencart/

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

19 Dec 2007, 9:57 AM
#2
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Post #2 by frank18

Thanks to "scrat" - I have done exactly what was suggested and it works fine - no more year 2036 - I might still be alive then which is my aim anyway. :yes:

With the Best of Health

Frank

Frank Riegel Natural Therapies

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

5 Feb 2008, 7:11 AM
#3
vivaknievel avatar

vivaknievel

New Zenner

Join Date:
Mar 2007
Location:
Los Angeles, CA
Posts:
45
Plugin Contributions:
0

Post #3 by vivaknievel

What was the solution? I have a similar problem and can't seem to find a solution. If you could please post how you solved this, I'd very much appreciate it, as it may help me pinpoint what I might do in my situation.

Thank you!

  • Jaye
17 Oct 2008, 1:36 PM
#4
tranqui69 avatar

tranqui69

New Zenner

Join Date:
Jun 2008
Posts:
2
Plugin Contributions:
0

Post #4 by tranqui69

Mee too, please post the solution!:frusty:

17 Oct 2008, 1:55 PM
#5
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Post #5 by schoolboy

The major area you need to change is in english.php (and remember, if you are editing the core file, save it to your overrides folder(s).

In english.php find:-

  @setlocale(LC_TIME, 'en_US.ISO_8859-1');
  define('DATE_FORMAT_SHORT', '%m/%d/%Y');  // this is used for strftime()
  define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime()
  define('DATE_FORMAT', 'm/d/Y'); // this is used for date()
  define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');

////
// Return date in raw format
// $date should be in format mm/dd/yyyy
// raw date is in format YYYYMMDD, or DDMMYYYY
  if (!function_exists('zen_date_raw')) {
    function zen_date_raw($date, $reverse = false) {
      if ($reverse) {
        return substr($date, 3, 2) . substr($date, 0, 2) . substr($date, 6, 4);
      } else {
        return substr($date, 6, 4) . substr($date, 0, 2) . substr($date, 3, 2);

Now, look CAREFULLY at this EDIT, to see what's changed:-

@setlocale(LC_TIME, 'en_UK.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('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');

////
// Return date in raw format
// $date should be in format dd/mm/yyyy
// raw date is in format YYYYMMDD, or DDMMYYYY
  if (!function_exists('zen_date_raw')) {
function zen_date_raw($date, $reverse = false) {
if ($reverse) {
          return substr($date, 0, 2) . substr($date, 3, 2) . substr($date, 6, 4);
} else {
  return substr($date, 6, 4) . substr($date, 3, 2) . substr($date, 0, 2);

The above edit will return the date in UK format, as DD/MM/YYYY.

But that's not all...

Further down in english.php, you will need to find DEFINE statements that refer to DATE, and where you see a DEFINE that is listed as MM/DD/YYYY, you must make the necessary edit to have it show as DD/MM/YYYY .

Remember, you may have various additional modules installed, and in their CONFIGURATION settings (generally controlled via your admin panel somewhere), you may have to re-set the date parameters as well (from MM/DD/YYYY to DD/MM/YYYY).

20 years a Zencart User

17 Oct 2008, 1:59 PM
#6
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Post #6 by schoolboy

... Oh... and remember now, after you've made the edits, when you INPUT any dates into your system, you must now put them in as DD/MM/YYYY !!! You may ALSO have to call up any previous date-specific data record, as it's quite likely to be misconfigured after your english.php edit.

20 years a Zencart User

17 Oct 2008, 2:04 PM
#7
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Post #7 by schoolboy

... One other thing...

@setlocale(LC_TIME, 'en_US.ISO_8859-1');

or

@setlocale(LC_TIME, 'en_UK.ISO_8859-1');

... are configured as US and UK respectively. You may need to insert your own country ISO here.

20 years a Zencart User

17 Oct 2008, 2:31 PM
#8
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Post #8 by schoolboy

Smack myself on the side of the head.

There is also an english.php in ADMIN .

You will need to correct the code there as well, in the same way you did for the CATALOG (template) version.

Bear in mind there is NO OVERRIDE for admin, so if/when you upgrade, you'll need to re-do the edit in the upgraded file.

20 years a Zencart User

3 Dec 2008, 6:16 AM
#9
silentavatar avatar

silentavatar

New Zenner

Join Date:
Oct 2008
Location:
Australia
Posts:
34
Plugin Contributions:
0

Post #9 by silentavatar

schoolboy:

The major area you need to change is in english.php (and remember, if you are editing the core file, save it to your overrides folder(s).

In english.php find:-

@setlocale(LC_TIME, 'en_US.ISO_8859-1');
define('DATE_FORMAT_SHORT', '%m/%d/%Y'); // this is used for strftime()
define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime()
define('DATE_FORMAT', 'm/d/Y'); // this is used for date()
define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');

////
// Return date in raw format
// $date should be in format mm/dd/yyyy
// raw date is in format YYYYMMDD, or DDMMYYYY
if (!function_exists('zen_date_raw')) {
function zen_date_raw($date, $reverse = false) {
if ($reverse) {
return substr($date, 3, 2) . substr($date, 0, 2) . substr($date, 6, 4);
} else {
return substr($date, 6, 4) . substr($date, 0, 2) . substr($date, 3, 2);

> 
> Now, look CAREFULLY at this EDIT, to see what's changed:-
> ```php
@setlocale(LC_TIME, 'en_UK.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('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');

////
// Return date in raw format
// $date should be in format dd/mm/yyyy
// raw date is in format YYYYMMDD, or DDMMYYYY
  if (!function_exists('zen_date_raw')) {
function zen_date_raw($date, $reverse = false) {
if ($reverse) {
          return substr($date, 0, 2) . substr($date, 3, 2) . substr($date, 6, 4);
} else {
  return substr($date, 6, 4) . substr($date, 3, 2) . substr($date, 0, 2);

The above edit will return the date in UK format, as DD/MM/YYYY.

But that's not all...

Further down in english.php, you will need to find DEFINE statements that refer to DATE, and where you see a DEFINE that is listed as MM/DD/YYYY, you must make the necessary edit to have it show as DD/MM/YYYY .

Remember, you may have various additional modules installed, and in their CONFIGURATION settings (generally controlled via your admin panel somewhere), you may have to re-set the date parameters as well (from MM/DD/YYYY to DD/MM/YYYY).

Hey schoolbuy,

New Zenner here...:blush:

I'm sounding like a real clutz here.. where is the override folder located that I need to save to? Or do I have to make one and put it somewhere?

Cheers,
MG :hug:

MG Page
"The Silent Avatar Speaks"
http://www.silentavatar.com/blog/

3 Dec 2008, 7:51 AM
#10
canopy avatar

canopy

Totally Zenned

Join Date:
Oct 2006
Posts:
625
Plugin Contributions:
0

Post #10 by canopy

Goh Koon Hoek, author of "e-Start Your Web Store with Zen Cart".
Printed book: www.lulu.com/content/10576284
Electronic book and Errata: www.cucumbermedia.com/store