Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2009
    Location
    Sydney, Australia
    Posts
    43
    Plugin Contributions
    0

    Default Can anyone explain how the date format works?

    I want our date format to be dd/mm/yyyy

    I am using an "addon" which allow me to upload customers I already have, but the add-on was written for USA ie mm/dd/yyyy. I have already made changes to the ../english.php file to allow my format to be dd/mm/yyyy on my site.

    But when I use the add-on it doesn't work because of the code below:
    PHP Code:
    if (ACCOUNT_DOB == 'true') {
            if (
    ENTRY_DOB_MIN_LENGTH >&& strlen($customers_dob) > 0) {

                
    $customers_dob str_replace('-','',$customers_dob);
                
    $customers_dob str_replace('/','',$customers_dob);

                
    $month = (int)substr($customers_dob42);
                
    $day = (int)substr($customers_dob62);
                
    $year = (int)substr($customers_dob04);

                if (!
    checkdate($month$day$year)) {
                    
    $errors[] = 'DOB is invalid (Must be YYYYMMDD, YYYY/MM/DD or YYYY-MM-DD)';
                }
            } else {
                
    $customers_dob '0001-01-01 00:00:00';
            }
        } 
    How can I modify this to allow the format to be dd/mm/yyy? I'm sure it has something to do with the "6" and "4" after $custromers_dob

    Thanks heaps in advance for any assistance or any ideas at all, I have spend days trying different method, just can't seen to figure it out?

  2. #2
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Can anyone explain how the date format works?

    You are mistaken about what that code does. It actually takes a date, not in US mm/dd/yyyy format, but in international format (as per the error message) and serves it to the php checkdate() function in US order only because that's what the checkdate function requires.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  3. #3
    Join Date
    Feb 2009
    Location
    Sydney, Australia
    Posts
    43
    Plugin Contributions
    0

    Default Re: Can anyone explain how the date format works?

    Thanks Kuroi, still getting the hang of this...

    Quick question...

    I can update the customers >> edit page with no problem.
    But when I want to add a member the date is messed up.

    Some examples:

    Putin 01010101 get 01/10/2001
    Putin 02010301 get 02/10/2001
    Putin 10050607 get 30/11/2036
    Putin 19720102 get 30/11/2036

    Any ideas? Thanks again for your help.

 

 

Similar Threads

  1. Could anyone tell me how to format the
    By suedouglas in forum General Questions
    Replies: 2
    Last Post: 29 Apr 2015, 09:38 PM
  2. Replies: 1
    Last Post: 15 Nov 2012, 02:22 PM
  3. How do I change the Date format?
    By tobicky in forum General Questions
    Replies: 62
    Last Post: 29 Jul 2011, 05:46 AM
  4. Please explain how it works...
    By sollysmum in forum General Questions
    Replies: 2
    Last Post: 27 May 2010, 01:55 PM
  5. Why can't I change the date format?
    By IPC1 in forum General Questions
    Replies: 2
    Last Post: 15 Aug 2009, 06:28 AM

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