Results 1 to 10 of 10
  1. #1
    Join Date
    Nov 2009
    Posts
    108
    Plugin Contributions
    0

    Default Featured Product date problem-I'm Stuck!

    I'm trying to set up a few Featured Products but when I set up the dates to start and finish, then save/insert, they change to 30/11/2036 for both start and finish. I go back and edit it again and it changes again.
    What would be the problem here? I'm stuck!

  2. #2
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: Featured Product date problem-I'm Stuck!

    On both the ADMIN and CATALOG sides of the store, there are english.php files, inside of which the date formatting is configured.

    These date formats should match, so if you are using mm/dd/yyyy in CATALOG, you should also be using mm/dd/yyyy in ADMIN.

    Open these two files to see what date formats are being applied. This might be where your issue lies... I'm not sure, but we can rule it out if the formats are identical in both files.
    20 years a Zencart User

  3. #3
    Join Date
    Nov 2009
    Posts
    108
    Plugin Contributions
    0

    Default Re: Featured Product date problem-I'm Stuck!

    Thanks for the reply.

    In both files (about line 31..)
    it says:
    define('DATE_FORMAT', 'd/m/Y'); // this is used for date()

    Is that the reference you were talking about?

    The admin file has this on the next line, whereas the catalog one hasn't:
    define('DATE_FORMAT_SPIFFYCAL', 'dd/MM/yyyy'); //Use only 'dd', 'MM' and 'yyyy' here in any order

  4. #4
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: Featured Product date problem-I'm Stuck!

    This entire section controls the date formatting:

    PHP Code:
    // 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_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($date32) . substr($date02) . substr($date64);
          } else {
            return 
    substr($date64) . substr($date02) . substr($date32);
          }
        }
      } 
    The above example is for mm/dd/yyyy and the LOCALE is set as US

    VERY CAREFULLY compare the above with what I have put below, which is the dd/mm/yyyy format for LOCALE UK

    PHP Code:
    // 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($date02) . substr($date32) . substr($date64);
    } else {
      return 
    substr($date64) . substr($date32) . substr($date02);
          }
        }
      } 
    NOTE THE DIFFERENCES, particularly in these lines:

    PHP Code:
    return substr($date02) . substr($date32) . substr($date64); 
    ... and yes... there is that little addition in the ADMIN file
    20 years a Zencart User

  5. #5
    Join Date
    Nov 2009
    Posts
    108
    Plugin Contributions
    0

    Default Re: Featured Product date problem-I'm Stuck!

    Darn it, it didn't work...

    The Long Format for the Catalog file was A,B,D,Y and I changed it to A,D,B,Y ( to replicate the admin one)......this didn't seem to change anything.
    The code-line that you pointed out for special attention was the same for both3,2 0,2 6,4) so I didn't touch them.
    Should I change the Locale to your UK one? Or leave it alone?

  6. #6
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: Featured Product date problem-I'm Stuck!

    Do you have time zone offset module installed?

    Is your server clock functioning OK and is it properly set? Ask your host...

    LOCALE should just match, but if you are UK, I'd set it to UK
    20 years a Zencart User

  7. #7
    Join Date
    Nov 2009
    Posts
    108
    Plugin Contributions
    0

    Default Re: Featured Product date problem-I'm Stuck!

    Success!
    I changed the 1st substr line to :0,2 - 3,2 - 6,4 (and the next line to 6,4 - 3,2 - 0,2)
    Thanks for getting me on the right track Schoolboy! Cheers.

  8. #8
    Join Date
    Nov 2009
    Posts
    108
    Plugin Contributions
    0

    Default Re: Featured Product date problem-I'm Stuck!

    Just got your last post...
    "Do you have time zone offset module installed?

    Is your server clock functioning OK and is it properly set? Ask your host...

    LOCALE should just match, but if you are UK, I'd set it to UK "

    As i just stated, everythings fine now, should I still check these things out with the Host though?
    Thanks again.

  9. #9
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: Featured Product date problem-I'm Stuck!

    Yeah... I did warn you to pay very careful attention to the lines - particularly those...

    Anyway, glad you got it sorted.
    20 years a Zencart User

  10. #10
    Join Date
    Jun 2008
    Posts
    187
    Plugin Contributions
    0

    Default Re: Featured Product date problem-I'm Stuck!

    So basically if i change includes/languages/english.php from:
    PHP Code:
    // 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_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($date32) . substr($date02) . substr($date64); 
          } else { 
            return 
    substr($date64) . substr($date02) . substr($date32); 
          } 
        } 
      } 
    to

    PHP Code:
    // 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($date02) . substr($date32) . substr($date64); 
    } else { 
      return 
    substr($date64) . substr($date32) . substr($date02); 
          } 
        } 
      } 
    this should change the date formatting globally?
    in both admin and catalogue?

    ofc this won't change previous orders/products etc but will change any new ones going forward?

    + will this cause issues with current dated things, like voucher codes with expiration dates etc?

    Andy.

 

 

Similar Threads

  1. Specials, featured product and salemaker problem
    By sinfully in forum Setting Up Specials and SaleMaker
    Replies: 0
    Last Post: 1 Feb 2011, 05:20 PM
  2. Date problem when adding featured product
    By nickgreaves in forum Bug Reports
    Replies: 10
    Last Post: 22 Jul 2010, 02:36 AM
  3. I'm Stuck With Featured Products.
    By Captain Tycoon in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 14 Jul 2010, 08:32 PM
  4. Replies: 5
    Last Post: 17 Mar 2010, 06:36 PM
  5. Why Can't I See The Expiry Date On Special or Featured Product?
    By Robert T in forum Setting Up Specials and SaleMaker
    Replies: 4
    Last Post: 13 Mar 2007, 10:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg