Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Can I Change mm/dd/yyyy to dd/mm/yyyy?


lozthejeweller

Recommended Posts

Hi everyone this is my first post as i have managed to get to this stage without a hitch. I have set up the store, configured titles, language, currency etc but a lot seems to remain configured for US users particularly the date format and some of the addressing format when new customers are registering. Is there any way of changing this??

Thanks in advance

Link to comment
Share on other sites

Hi everyone this is my first post as i have managed to get to this stage without a hitch. I have set up the store, configured titles, language, currency etc but a lot seems to remain configured for US users particularly the date format and some of the addressing format when new customers are registering. Is there any way of changing this??

Thanks in advance

 

Look in the top of \catalog\includes\languages\english.php for a block like this:

 

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

 

 

and in \catalog\admin\includes\languages\english.php for a block like this:

 

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

 

All you need to do is move the 'm's and 'd's around like I have to get the required format. If you've got other languages installed you can set these language files up according to the country.

Link to comment
Share on other sites

Look in the top of \catalog\includes\languages\english.php for a block like this:

 

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

and in \catalog\admin\includes\languages\english.php for a block like this:

 

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

 

All you need to do is move the 'm's and 'd's around like I have to get the required format. If you've got other languages installed you can set these language files up according to the country.

Link to comment
Share on other sites

All you need to do is move the 'm's and 'd's around

 

Wrong! There's more to it than that.

 

Look at the top of includes/languages/german.php or spanish.php and the same for admin/includes/languages/german.php or spanish.php and look for this code:

 

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);
 }
}

 

Copy all of it into includes/languages/english.php and admin/includes/languages/english.php - replacing the code which is there.

 

You also need to make text edits to includes/languages/english.php and admin/includes/languages/english.php - where it says what format the date must be entered.

 

Vger

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...