ctbhost Posted December 16, 2005 Posted December 16, 2005 can anyone tell me how i can change the date format in the admin area to be dd/mm/yy instead of the default mm/dd/yy
♥Vger Posted December 16, 2005 Posted December 16, 2005 If you look in Contributions there is one which is called something like osCommerce UK or UK osCommerce, which includes all the files to change the date format both in the Catalog and in Admin. You can also look in catalog/includes/languages/german.php or spanish.php, and in catalog/admin/includes/languages/german.php or spanish.php because the code is already in them for dd/mm/yyyy format. It's only the english.php which uses the American mm/dd/yyyy format. Vger
ctbhost Posted December 16, 2005 Author Posted December 16, 2005 If you look in Contributions there is one which is called something like osCommerce UK or UK osCommerce, which includes all the files to change the date format both in the Catalog and in Admin. You can also look in catalog/includes/languages/german.php or spanish.php, and in catalog/admin/includes/languages/german.php or spanish.php because the code is already in them for dd/mm/yyyy format. It's only the english.php which uses the American mm/dd/yyyy format. Vger Found it IN /admin/includes/languages/english.php CHANGE: 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'); TO: 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'); AND IN /includes/languages/english.php CHANGE: 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'); TO: 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');
bobccc Posted December 16, 2005 Posted December 16, 2005 Thanks ctbhost and vger, saved me some work too :D
♥Vger Posted December 16, 2005 Posted December 16, 2005 Sorry folks, but you didn't get the important part of it. You also need to change 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) { 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); } } 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 = 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); } } Vger
bobccc Posted December 17, 2005 Posted December 17, 2005 Thanks again, I take it that we change both the English.php in the language areas.. :) Bob
Recommended Posts
Archived
This topic is now archived and is closed to further replies.