Page 2 of 7 FirstFirst 1234 ... LastLast
Results 11 to 20 of 63
  1. #11
    Join Date
    Jul 2007
    Posts
    156
    Plugin Contributions
    0

    Default Re: How do I change the Date?

    Thanks gilby, I eventually got it working.

    For anyone else who wants to know here is what I done step by step to change the date format from mm/dd/yyyy to dd/mm/yyyy:

    1. open file includes/languages/<YOUR_TEMPLATE>/<YOUR_LANGUAGE>.php

    2. find this section around line 22:
    @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');
    and replace with:
    @setlocale(LC_TIME, 'en_US.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');
    3. in the same file find this section around line 29:
    // 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);
    }
    }
    }
    and replace with:
    // 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, 0, 2) . substr($date, 3, 2) . substr($date, 6, 4);
    } else {
    return substr($date, 6, 4) . substr($date, 3, 2) . substr($date, 0, 2);
    }
    }
    }
    4. In the same file find this section around line 67:
    // text for date of birth example
    define('DOB_FORMAT_STRING', 'mm/dd/yyyy');
    and replace with:
    // text for date of birth example
    define('DOB_FORMAT_STRING', 'dd/mm/yyyy');
    5. In the same file find this section around line 200:
    define('ENTRY_DATE_OF_BIRTH_ERROR', 'Is your birth date correct? Our system requires the date in this format: MM/DD/YYYY (eg 05/21/1970)');
    define('ENTRY_DATE_OF_BIRTH_TEXT', '* (eg. 05/21/1970)');
    and replace with:
    define('ENTRY_DATE_OF_BIRTH_ERROR', 'Is your birth date correct? Our system requires the date in this format: DD/MM/YYYY (eg 21/05/1970)');
    define('ENTRY_DATE_OF_BIRTH_TEXT', '* (eg. 21/05/1970)');
    6. Open file admin/includes/languages/<YOUR_LANGUAGE>.php

    7. Find this section around line 20:
    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('PHP_DATE_TIME_FORMAT', 'm/d/Y H:i:s'); // this is used for date()
    define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');
    define('DATE_FORMAT_SPIFFYCAL', 'MM/dd/yyyy'); //Use only 'dd', 'MM' and 'yyyy' here in any order
    and replace with:
    setlocale(LC_TIME, 'en_US.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
    8. In the same file find this section around line 29:
    // Return date in raw format
    // $date should be in format mm/dd/yyyy
    // raw date is in format YYYYMMDD, or DDMMYYYY
    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);
    }
    }
    and replace with:
    // Return date in raw format
    // $date should be in format mm/dd/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);
    }
    }
    9. In the same file find this section around line 85:
    // text for date of birth example
    define('DOB_FORMAT_STRING', 'mm/dd/yyyy');
    and replace with:
    // text for date of birth example
    define('DOB_FORMAT_STRING', 'dd/mm/yyyy');
    10. In the same file find this section around line 204:
    define('JS_DOB', '* The \'Date of Birth\' entry must be in the format: xx/xx/xxxx (month/date/year).\n');
    and replace with:
    define('JS_DOB', '* The \'Date of Birth\' entry must be in the format: xx/xx/xxxx (date/month/year).\n');
    11. In the same file find this section around line 231:
    define('ENTRY_DATE_OF_BIRTH_ERROR', '&nbsp;<span class="errorText">(eg. 05/21/1970)</span>');
    and replace with:
    define('ENTRY_DATE_OF_BIRTH_ERROR', '&nbsp;<span class="errorText">(eg. 21/05/1970)</span>');
    12. Pat yourself on the back, you're all done.

  2. #12

    Default Re: How do I change the Date?

    Quote Originally Posted by Phil020782 View Post
    Thanks gilby, I eventually got it working.

    For anyone else who wants to know here is what I done step by step to change the date format from mm/dd/yyyy to dd/mm/yyyy:

    etc
    That all worked sweet, thanks a lot.

  3. #13
    Join Date
    Jun 2007
    Location
    Australia - Melbourne
    Posts
    310
    Plugin Contributions
    6

    Default Re: How do I change the Date?

    Thanks a lot phil!

  4. #14
    Join Date
    Jul 2007
    Posts
    12
    Plugin Contributions
    0

    Default Re: How do I change the Date?

    Great, thanks for this Phil!
    This post should be referenced in the FAQs....
    =========================================
    The Organic Store

  5. #15
    Join Date
    Jan 2007
    Posts
    35
    Plugin Contributions
    0

    Default Re: How do I change the Date format?

    I want to change year to Buddhism. I know that I have to add +543 after some function to be corrected. However, I don't know how or where can I edit it?

  6. #16
    Join Date
    Sep 2007
    Posts
    10
    Plugin Contributions
    0

    Default Re: How do I change the Date?

    Just a quick heads up, thank your for this post. It works a treat!

  7. #17
    Join Date
    Nov 2007
    Posts
    14
    Plugin Contributions
    0

    Default Re: How do I change the Date format?

    Thanks :) Worked a treat!

  8. #18
    Join Date
    Sep 2006
    Posts
    78
    Plugin Contributions
    1

    Default Re: How do I change the Date format?

    Yes that works very well, thank you,

    I'm not sure if its planned but wouldnt it be great to have a option in admin to change between US and UK date formats.

  9. #19
    Join Date
    Jan 2008
    Posts
    28
    Plugin Contributions
    0

    Default Re: How do I change the Date format?

    I just wanted to say a HUGE thanks for this Phil!

    As someone with no knowledge of programming and new to Zen cart (the person who designed my website chose to use it)
    Your step by step instructions were just what I needed to be successful at making the change I wanted to!!

    A godsend for a beginner!!
    Thanks so much!

    Debbie

  10. #20
    Join Date
    May 2006
    Posts
    36
    Plugin Contributions
    0

    Default Re: How do I change the Date format?

    This was great info, thanks. However, I have been wading through tutorials and little warnings pop up now and again about making sure your files don't get over-ridden during an update. For this reason (AT STEP 6) I copied the file admin/includes/languages/<YOUR_LANGUAGE>.php into
    admin/includes/languages/<YOUR_TEMPLATE>/<YOUR_LANGUAGE>.php and made my changes there.

    It seems to work and I don't know if I'm just being over cautious or not.

 

 
Page 2 of 7 FirstFirst 1234 ... LastLast

Similar Threads

  1. How do I change date format?
    By craftyrose in forum Basic Configuration
    Replies: 3
    Last Post: 21 Aug 2010, 03:52 AM
  2. change date format how??
    By kitcorsa in forum General Questions
    Replies: 3
    Last Post: 30 Oct 2008, 02:54 PM
  3. Replies: 0
    Last Post: 14 Apr 2008, 08:54 PM
  4. How to change date format
    By dail in forum Customization from the Admin
    Replies: 0
    Last Post: 13 Jun 2007, 08:35 AM
  5. How change date format to spanish?
    By Stack A Brown in forum General Questions
    Replies: 1
    Last Post: 17 Apr 2007, 09:31 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR