Page 1 of 3 123 LastLast
Results 1 to 10 of 63

Hybrid View

  1. #1
    Join Date
    May 2007
    Posts
    38
    Plugin Contributions
    0

    Default Re: How do I change the Date?

    No i tried its please try and sign up ? i editted so that the error messages and the examples are correct but it won't accepted dd/mm/yyyy

    http://crazy-hosting.co.uk/########/inde...create_account

  2. #2
    Join Date
    Jul 2007
    Posts
    156
    Plugin Contributions
    0

    Default Re: How do I change the Date?

    I'm having a little trouble changing the date format to dd/mm/yyyy. I managed to get it all changed and it works but in the create account and my account information the example still says 05/21/1970. But it is working in the correct format if you enter it was 05/21/1970 it returns an error saying it should be in the format 05/21/1970.

    can anyone help me change the example text please?

  3. #3
    Join Date
    Aug 2005
    Location
    Vic, Oz
    Posts
    1,905
    Plugin Contributions
    5

    Default Re: How do I change the Date?

    Quote Originally Posted by Phil020782 View Post
    I'm having a little trouble changing the date format to dd/mm/yyyy. I managed to get it all changed and it works but in the create account and my account information the example still says 05/21/1970. But it is working in the correct format if you enter it was 05/21/1970 it returns an error saying it should be in the format 05/21/1970.

    can anyone help me change the example text please?
    You need to edit admin\includes\languages\english.php

    and

    includes\languages\english.php
    (edit and copy this one into your override directory)
    includes\languages\YOUR_TEMPLATE\english.php

  4. #4
    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.

  5. #5

    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.

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

    Default Re: How do I change the Date?

    Thanks a lot phil!

  7. #7
    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

  8. #8
    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!

  9. #9
    Join Date
    Nov 2007
    Posts
    14
    Plugin Contributions
    0

    Default Re: How do I change the Date format?

    Thanks :) Worked a treat!

  10. #10
    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.

 

 
Page 1 of 3 123 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

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