This is a discussion on Date format question within the osCommerce 2.2 Modification Help forums, part of the osCommerce 2.2 Forums category; Hi, Does anyone know how I can change the date format of "Upcoming Products" "date Expected" date? It is currently ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| |||
| |||
| Hi, Does anyone know how I can change the date format of "Upcoming Products" "date Expected" date? It is currently displaying in MM/DD/YYYY but my client would like to display it like this DD/MM/YYYY (or something similar). My first thought was changing the date format in the DB, but I quickly changed my mind on this as I imagine that all the internal date processing will be upset if I do something like this. Is that correct? Any comments/recommendations would really be appreciated on this, as it is the last thing before the site is totally completed. Thanks in advance Dr Evil |
| Sponsored Links | ||
| ||
|
#2
| |||
| |||
| In catalog/includes/languages/english.php find the following code: Code: 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');
////
// 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);
}
}
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 dd/mm/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);
}
}
Hope that helps |
|
#3
| |||
| |||
| and remember always create backups ...n sorry for the duplicate posting |
|
#4
| ||||
| ||||
| Dudes, I use this code o change date format and have success on it. Thanks, But in the footer the data still apear in English and I wish to change it to Portuguese, how I can do that? Best Regards, Marcelo |
| Sponsored Links | ||
| ||
| Thread Tools | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Quick about date format | damnedpig | osCMax v1.7 Discussion | 2 | 07-02-2004 08:27 AM |
| Registration error, Date format | marbor | osCMax v1.7 Discussion | 1 | 02-04-2004 06:21 AM |
| How to set date in footer to another format | stando | osCMax v1.7 Discussion | 7 | 01-23-2004 06:50 AM |
| Change date format | don | osCommerce 2.2 Installation Help | 1 | 01-31-2003 07:03 PM |
| Date format | killermonkey | osCommerce 2.2 Modification Help | 3 | 01-24-2003 02:07 AM |