Zen Cart Logo

Foxed by DOB

Locked

Views: 1,019

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
31 Mar 2010, 6:36 PM
#1
kryspen avatar

kryspen

New Zenner

Join Date:
Feb 2010
Location:
East Anglia
Posts:
52
Plugin Contributions:
0

Foxed by DOB

I'm building a store with the latest version of zen-cart. I've just moved it from my local machine to a web server. I built a new database, zipped up my zen-cart installation and re-installed it. In the process I've lost the passwords for my test users.

I tried to log them in again but every time I do I get the message "'Is your birth date correct? Our system requires the date in this format: DD/MM/YYYY (eg 21/05/1970)')"

I've spent half an afternoon poring through the fora, the FAQ's and my code. I can find nothing I've done wrong. Anyone help me, please?

Cheers,

Dave

31 Mar 2010, 6:47 PM
#2
twaddle avatar

twaddle

Banned

Join Date:
Jul 2009
Location:
Prague, Czech Republic
Posts:
478
Plugin Contributions:
0

Re: Foxed by DOB

Ah, I read something about this just today on here.

In one of the admin files, both 'date files' have to match, ie there's two files, one also has an extra line. Sorry, can't remember which file or in which thread he wrote it, but I'd say within the last 6 hours - so try here looking for dates http://www.zen-cart.com/forum/search.php?do=getdaily

1 Apr 2010, 8:07 AM
#4
kryspen avatar

kryspen

New Zenner

Join Date:
Feb 2010
Location:
East Anglia
Posts:
52
Plugin Contributions:
0

Re: Foxed by DOB

Thanks for that - but I've been through both files with a fine tooth comb. They match, and they match what everyone else says they should be for UK dates.

But I still get the wretched error message!!

It's driving me bonkers!:censored:

Cheers,

Dave
https://www.fernslist.com

1 Apr 2010, 9:04 AM
#5
schoolboy avatar

schoolboy

Totally Zenned

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

Re: Foxed by DOB

Dave...

includes/languages/YOUR_TEMPLATE/english.php

Date setting must be:

// look in your $PATH_LOCALE/locale directory for available locales..
// on RedHat try 'en_US'
// on FreeBSD try 'en_US.ISO_8859-1'
// on Windows try 'en', or 'English'
@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);
      }
    }
  }

And in admin/includes/languages/english.php

// 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_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('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

////
// Return date in raw format
// $date should be in format dd/mm/yyyy
// raw date is in format YYYYMMDD, or DDMMYYYY
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);
  }

You need to match up these settings EXACTLY, particularly the lines:

  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);

Either carefully make the edits manually, or just clip what you see above and overwrite the relevant section.

1 Apr 2010, 12:05 PM
#6
kryspen avatar

kryspen

New Zenner

Join Date:
Feb 2010
Location:
East Anglia
Posts:
52
Plugin Contributions:
0

Re: Foxed by DOB

GOT IT!:clap:

Going through the files again compared to yours I finally realised that, in the admin/includes/languages/english.php I had:

“setlocale” not “@setlocale”.

Many thanks for your help.

Cheers,

Dave
https://www.Fernslist.com

19 May 2010, 1:41 AM
#7
customgiftsshoppe avatar

customgiftsshoppe

New Zenner

Join Date:
May 2010
Posts:
16
Plugin Contributions:
0

Re: Foxed by DOB

I have tried this and I can't get it to work, I removed it from both files, however, what file do I need to edit to remove it from the sign up page?

19 May 2010, 3:43 AM
#8
customgiftsshoppe avatar

customgiftsshoppe

New Zenner

Join Date:
May 2010
Posts:
16
Plugin Contributions:
0

Re: Foxed by DOB

the admin panel....DOH!

19 May 2010, 10:36 PM
#9
schoolboy avatar

schoolboy

Totally Zenned

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

Re: Foxed by DOB

customgiftsshoppe:

I have tried this and I can't get it to work, I removed it from both files, however, what file do I need to edit to remove it from the sign up page?

:shocking::shocking::shocking:

This is a FUNDAMENTAL bit of ESSENTIAL CODE..., specifying the date formats for the ENTIRE SITE! You should not be hacking at the core code unless you know what you are doing.