ronan Posted October 27, 2005 Share Posted October 27, 2005 hey, How do you change the date format. Im in Europe and the site is set to the US date format as standard i.e. month / day / year. Thanks :D Link to comment Share on other sites More sharing options...
GraphicsGuy Posted October 27, 2005 Share Posted October 27, 2005 Here is a thread that deals with that: http://www.oscommerce.com/forums/index.php?s=&...indpost&p=71150 Rule #1: Without exception, backup your database and files before making any changes to your files or database. Rule #2: Make sure there are no exceptions to Rule #1. Link to comment Share on other sites More sharing options...
ronan Posted October 28, 2005 Author Share Posted October 28, 2005 I've followed what was done in that link but it didnt work. Why is it turning out to be so difficult to change such a standard thing??????? I was told by someone to check the www.php.net site for date format functions but even if i could understand that i wouldnt know how to apply it to an oscommerce store!! Anyone know what to do? Link to comment Share on other sites More sharing options...
Guest Posted October 28, 2005 Share Posted October 28, 2005 It will eventually work there are few places. Also change the order in the tep_date function in that same file. from this //// // 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) { to this //// // 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 = true) { Link to comment Share on other sites More sharing options...
ronan Posted October 28, 2005 Author Share Posted October 28, 2005 Got it sorted!! Eventualy!! I found this, it works a treat for anyone else in the same boat as i was. Date format: * 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 ********************* CODE define('ENTRY_DATE_OF_BIRTH_ERROR', 'Your Date of Birth must be in this format: MM/DD/YYYY (eg 05/21/1970)'); to CODE define('ENTRY_DATE_OF_BIRTH_ERROR', 'Your Date of Birth must be in this format: DD/MM/YYYY (eg 21/05/1970)'); CODE define('ENTRY_DATE_OF_BIRTH_TEXT', '* (eg. 05/21/1970)'); to CODE define('ENTRY_DATE_OF_BIRTH_TEXT', '* (eg. 21/05/1970)'); CODE define('DOB_FORMAT_STRING', 'mm/dd/yyyy'); to CODE define('DOB_FORMAT_STRING', 'dd/mm/yyyy'); ___________________________________________________________________ To change to format in the admin section, you'll have to edit the admin's files. ******************************************************************** * Open catalog/admin/includes/languages/english.php (this is for your admin 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('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'); //// // 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 ********************* CODE define('DOB_FORMAT_STRING', 'mm/dd/yyyy'); to CODE define('DOB_FORMAT_STRING', 'dd/mm/yyyy'); Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.