Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2013
    Location
    Sydney, Australia
    Posts
    140
    Plugin Contributions
    0

    Default After changing date format still getting error

    Hello, I have followed this tut on how to change date format to UK format. (several times) and read other threads in this forum such as https://www.zen-cart.com/showthread....he-Date-format and
    https://www.zen-cart.com/content.php...-to-dd-mm-yyyy

    I have made the changes to includes/languages/custom/english.php and also to admin/includes/languages/english.php

    I noticed in my admin/includes/languages/english.php there is no
    STEP 9: // text for date of birth example
    define('DOB_FORMAT_STRING', 'mm/dd/yyyy'); (I added it in but it makes no difference)

    I get error : Error Is your birth date correct? Our system requires the date in this format: MM/DD/YYYY (eg 05/21/1970)
    Also the DOB example text still says: 05/21/1970 !!!

    I have done this before with no problems. This is my first using 1.5.4 can't understand why it's not changing.

  2. #2
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,378
    Plugin Contributions
    9

    Default Re: After changing date format still getting error

    Quote Originally Posted by Annie_zaz View Post
    ...
    I have made the changes to includes/languages/custom/english.php and also to admin/includes/languages/english.php
    ...
    Did you make these changes:

    PHP Code:
     
      
    @setlocale(LC_TIME'en_AU.UTF-8'); 
      
    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 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($date02) . substr($date32) . substr($date64); 
          } else { 
            return 
    substr($date64) . substr($date32) . substr($date02); 
          } 
        } 
      } 
    Above code reflects the settings in my (Aussie) stores.

  3. #3
    Join Date
    Mar 2013
    Location
    Sydney, Australia
    Posts
    140
    Plugin Contributions
    0

    Default Re: After changing date format still getting error

    Hi Frank18 thanks for your reply.

    I figured out that I had edited my "Çustom" english php, but then I changed templates and am now using another one by a different name and didn't edit that one (which I should've in the first place). Doh.

    But you have helped me as I actually didn't have @setlocale(LC_TIME, 'en_AU.UTF-8'); in my includes/languages/custom/english.php
    What have you got written in your admin/includes/languages/english.php. ? I have English_United Kingdom.1252 is that what you have?
    I now have:
    // look in your $PATH_LOCALE/locale directory for available locales..
    $locales = array('en_GB', 'en_AU.utf8', 'en', 'English_United Kingdom.1252');
    @setlocale(LC_TIME, $locales);

  4. #4
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,378
    Plugin Contributions
    9

    Default Re: After changing date format still getting error

    For both files (admin and store side) it should be

    PHP Code:
    // look in your $PATH_LOCALE/locale directory for available locales..
    $locales = array('en_AU''en_AU.utf8''en''English_Australia.1252');
    @
    setlocale(LC_TIME$locales); 

  5. #5
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,874
    Plugin Contributions
    96

    Default Re: After changing date format still getting error

    There are actually three (3) files that come into play here:
    1. /YOUR_ADMIN/includes/languages/english.php, as you've described
    2. /includes/languages/YOUR_TEMPLATE/english.php, where you'll enter the updated define statements and the re-arrangement of the zen_date_raw function
    3. /includes/languages/english.php, which is loaded after the template-version, so all the locale-setting statements that you've identified for the template-override directory must be specified here for those settings to take effect.

  6. #6
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,378
    Plugin Contributions
    9

    Default Re: After changing date format still getting error

    Quote Originally Posted by lat9 View Post
    There are actually three (3) files that come into play here:
    1. /YOUR_ADMIN/includes/languages/english.php, as you've described
    2. /includes/languages/YOUR_TEMPLATE/english.php, where you'll enter the updated define statements and the re-arrangement of the zen_date_raw function
    3. /includes/languages/english.php, which is loaded after the template-version, so all the locale-setting statements that you've identified for the template-override directory must be specified here for those settings to take effect.
    Hmm... in more than 8 years of using ZC for many stores, I never changed anything in the core english.php file and always had the desired result using the template override file, no problems whatsoever. So, I am not so sure if it is necessary to change the locale settings in the core english.php file as well.

  7. #7
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,378
    Plugin Contributions
    9

    Default Re: After changing date format still getting error

    Too late to edit my post above.

    The Wiki does not specify that one needs to change the core file as well. Instead it clearly states to copy the core file first and then make the changes (using the override as usual).

    See https://www.zen-cart.com/wiki/index.php/Date_Format

 

 

Similar Threads

  1. v154 Changing Date Format in 1.54 to UK
    By nigelt74 in forum General Questions
    Replies: 5
    Last Post: 20 Jul 2015, 12:18 PM
  2. v154 V154 Still Getting Handshake Error After Upgrade
    By Rick5150 in forum PayPal Express Checkout support
    Replies: 31
    Last Post: 6 Feb 2015, 10:01 PM
  3. v154 Still getting checkout error for PayPal even after update.
    By Jen Will in forum PayPal Express Checkout support
    Replies: 21
    Last Post: 5 Feb 2015, 07:42 AM
  4. Changing Date to UK format
    By startrek in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 29 May 2007, 08:54 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