Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

change date format from mm/dd/yy to dd/mm/yy


ctbhost

Recommended Posts

Posted

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

Posted
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');

Posted

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...