Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Changing date format


ronan

Recommended Posts

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

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

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

Archived

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

×
×
  • Create New...