jeellison Posted March 22, 2005 Share Posted March 22, 2005 Hi all, Hope your all doing well. A quick question which im sure is easy but I just cant seem to find it. Where abouts to I change the format of date of birth from mm/dd/yyyy to dd/mm/yyyy for customers signing up? Any help will be greatly appreciated. Best Regards J Link to comment Share on other sites More sharing options...
Guest Posted March 22, 2005 Share Posted March 22, 2005 Here's how to do it. (remember to backup before any modification) Also chage the country code to match yours (this example uses GB for UK) ******************************************************************** * Open catalog/includes/languages/english.php (this is for your catalog section) * The changes are highlighted. ******************************************************************** @setlocale(LC_TIME, 'en_GB.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 mm/dd/yyyy // raw date is in format YYYYMMDD, or DDMMYYYY function tep_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); } } ********************* Also change the following ********************* define('ENTRY_DATE_OF_BIRTH_ERROR', 'Your Date of Birth must be in this format: MM/DD/YYYY (eg 05/21/1970)'); to define('ENTRY_DATE_OF_BIRTH_ERROR', 'Your Date of Birth must be in this format: DD/MM/YYYY (eg 21/05/1970)'); define('ENTRY_DATE_OF_BIRTH_TEXT', '* (eg. 05/21/1970)'); to define('ENTRY_DATE_OF_BIRTH_TEXT', '* (eg. 21/05/1970)'); define('DOB_FORMAT_STRING', 'mm/dd/yyyy'); to define('DOB_FORMAT_STRING', 'dd/mm/yyyy'); Link to comment Share on other sites More sharing options...
jeellison Posted March 22, 2005 Author Share Posted March 22, 2005 Thank you ever so much. Best Regards J Link to comment Share on other sites More sharing options...
Guest Posted October 27, 2005 Share Posted October 27, 2005 Thank you ever so much. Best Regards J I needed this functionality as well - brilliant, this thread worked like a charm! Link to comment Share on other sites More sharing options...
rozesky Posted February 28, 2006 Share Posted February 28, 2006 Thank you ever so much. Best Regards J this has helped me thanks alot :thumbsup: Link to comment Share on other sites More sharing options...
sallyvigar Posted March 13, 2006 Share Posted March 13, 2006 thank you from me too ! this works!! Link to comment Share on other sites More sharing options...
♥Vger Posted March 13, 2006 Share Posted March 13, 2006 Don't forget to do the same in admin/includes/languages/english.php Vger Link to comment Share on other sites More sharing options...
Guest Posted September 25, 2006 Share Posted September 25, 2006 Thanks for the very clear and easy to use instructions! Works in the catalog and in admin :) Link to comment Share on other sites More sharing options...
PatForde Posted October 3, 2007 Share Posted October 3, 2007 An absolute Godsend Many thanks Link to comment Share on other sites More sharing options...
edmond1815 Posted February 25, 2008 Share Posted February 25, 2008 I just tried your indications. I put : @setlocale(LC_TIME, 'ro_RO.ISO_8859-2'); But the date is still in english format: Monday 25 February .. instead of Luni, 25 Februarie. What should i change? Thank you, Edmond Link to comment Share on other sites More sharing options...
Guest Posted February 25, 2008 Share Posted February 25, 2008 I just tried your indications. I put :@setlocale(LC_TIME, 'ro_RO.ISO_8859-2'); But the date is still in english format: Monday 25 February .. instead of Luni, 25 Februarie. What should i change? Thank you, Edmond Something in one of the language files that you are using. You should consider if you want dob to be collected. I can see no valid reason for it. Link to comment Share on other sites More sharing options...
d_paulo Posted March 20, 2008 Share Posted March 20, 2008 Something in one of the language files that you are using. You should consider if you want dob to be collected. I can see no valid reason for it. Some times it just doesn't work and this could be just an simple wrong configuration to server where your page is located. Link to comment Share on other sites More sharing options...
psg Posted March 20, 2008 Share Posted March 20, 2008 Hi, Thanks for this great contribution. I'm having a small problem on the 'Account_edit.php' file. I'm using the "Pulldown Date Of Birth V1.1 for EU date format (dd-mm-yyyy) stores". I can not edit the date of birth; it only accepts 1-12 in the day’s field. When you select to "View or change my account information", and for example the date of birth was "23 June 1967" the date of birth is displayed as "1 June 1967" and when you try to change it to the correct DOB i.e. 23 June 1967 - the following error message is displayed "Your Date of Birth must be in this format: DD/MM/YYYY (eg 21/05/1970)". I think the day field in the 'account_edit.php' is coded to accept months (1-12) instead of days (1-31). It works fine in the 'create_account.php' file. Can some one please help? Best wishes, Paul Link to comment Share on other sites More sharing options...
Alexian Posted April 2, 2008 Share Posted April 2, 2008 thank you!! :) Link to comment Share on other sites More sharing options...
ipatel Posted September 11, 2008 Share Posted September 11, 2008 Thanks!!! Great clear instructions. Appreciate the effort. Link to comment Share on other sites More sharing options...
superkingkong Posted November 14, 2008 Share Posted November 14, 2008 thank you very much :) the "installation thread" on the sticky is not accurate. It didn't mention about changing this one... 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); } thus i was having problem earlier... until i found out this thread :) btw, i'm using the DOB, same as psg. now, it's working like a charm! Link to comment Share on other sites More sharing options...
hlee Posted January 28, 2009 Share Posted January 28, 2009 Problem solved. Thank you so much. Link to comment Share on other sites More sharing options...
anola82 Posted July 27, 2009 Share Posted July 27, 2009 THANKYOU SO MUCH......... I couldnt for the life of me get this right, I had changed everything but the numbers, thank you for highlighting the items needing to be changed, you got rid of my week long headache! :) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.