Guest Posted March 29, 2005 Share Posted March 29, 2005 Hello, I'm trying to change the date and order was placed from the American mm/dd/yy to the English dd/mm/yy. I have changed the english.php file in includes/languages/ but this hasn't worked. On the invoice and packing slip the following code is being used to call the purchase date: php echo tep_date_short($order->info['date_purchased']); Hope you can help. Thanks in advance -turner2000 Link to comment Share on other sites More sharing options...
Guest Posted March 29, 2005 Share Posted March 29, 2005 Here is what I use. ******************************************************************** * 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...
Guest Posted March 29, 2005 Share Posted March 29, 2005 Hey, Thanks for the quick reply - I have made the above changes but it hasn't worked. In admin it still shows the date as mm/dd/yy and the same for invoice and packing slip. It works ok if I just need to input todays date but I am calling the order date which is still showing as mm/dd/yy. -turner2000 Link to comment Share on other sites More sharing options...
Guest Posted March 29, 2005 Share Posted March 29, 2005 As stated above, that modification was for your catalog section. 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_UK.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 ********************* 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...
Guest Posted March 29, 2005 Share Posted March 29, 2005 Thanks - that's sorted it. I'm still trying to get my head around OSCommerce. Everything seems to be in so many places but anyway thanks again for your help! Link to comment Share on other sites More sharing options...
Guest Posted March 29, 2005 Share Posted March 29, 2005 Correction. UK does not exist in the unix-based-OS time definition: Use GB or GMT instead. Change setlocale(LC_TIME, 'en_UK.ISO_8859-1'); to setlocale(LC_TIME, 'en_GB.ISO_8859-1'); or setlocale(LC_TIME, 'en_GMT.ISO_8859-1'); Link to comment Share on other sites More sharing options...
Slant Posted April 14, 2005 Share Posted April 14, 2005 :thumbsup: many thanks. Link to comment Share on other sites More sharing options...
Guest Posted May 6, 2005 Share Posted May 6, 2005 Hi Does anyone know what the Australian time code is for unix? Ie GB = England Does AU = Australia and is this all necessary? Link to comment Share on other sites More sharing options...
Geordiedan Posted May 20, 2005 Share Posted May 20, 2005 Alpha Ray - this forum is a mine of info, your post is just what I needed :) Thanks! Dan Link to comment Share on other sites More sharing options...
amx_dk Posted June 15, 2005 Share Posted June 15, 2005 Correction. UK does not exist in the unix-based-OS time definition: Use GB or GMT instead. Change setlocale(LC_TIME, 'en_UK.ISO_8859-1'); to setlocale(LC_TIME, 'en_GB.ISO_8859-1'); or setlocale(LC_TIME, 'en_GMT.ISO_8859-1'); <{POST_SNAPBACK}> Where can I find other "unix-based-OS time definition"? I need to change it to GMT+1 and with danish has langues, as I get english days on my invoices, eg. monday and wednesday Link to comment Share on other sites More sharing options...
Guest Posted July 3, 2005 Share Posted July 3, 2005 I have tried in admin/includes/languages/english.php setlocale(LC_TIME, 'en_GMT.ISO_8859-1'); setlocale(LC_TIME, 'en_GB.ISO_8859-1'); setlocale(LC_TIME, 'en_UK.ISO_8859-1'); And my time in Admin is still showing 7 hours behind where my server is located :( Any ideas why this is? Link to comment Share on other sites More sharing options...
Hendrix Posted July 6, 2005 Share Posted July 6, 2005 I have tried in admin/includes/languages/english.php setlocale(LC_TIME, 'en_GMT.ISO_8859-1'); setlocale(LC_TIME, 'en_GB.ISO_8859-1'); setlocale(LC_TIME, 'en_UK.ISO_8859-1'); And my time in Admin is still showing 7 hours behind where my server is located Any ideas why this is? Is your server running on MS Windows OS? If so, then you can try: @setlocale(LC_TIME, 'English'); Link to comment Share on other sites More sharing options...
Guest Posted July 6, 2005 Share Posted July 6, 2005 No its a Linux server, and the hosts are stumped too. Link to comment Share on other sites More sharing options...
halluzineyt Posted November 17, 2009 Share Posted November 17, 2009 hello what if i like it to be yr.day.month im confused with this part 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); Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.