Zen Follower
- Join Date:
- Jul 2007
- Location:
- Jakarta
- Posts:
- 346
- Plugin Contributions:
- 0
Changing the DOB date format customers to use DDMMYYYY
I'm setting up a language other than English on my site, in this case Indonesian. I need the date format to use DDMMYYY.
I've attempted to accomplish this by changing the defines in languages/MY_TEMPLATE/indonesian.php
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()
// raw date is in format YYYYMMDD, or DDMMYYYY
if (!function_exists('zen_date_raw')) {
function zen_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);
}
}
}
// text for date of birth example
define('DOB_FORMAT_STRING', 'dd/mm/yyyy');
The date entered as 07/02/1972 is saved as Jun 2 1972. But when redisplayed it appears in the format of DDMMYYYY (02/07/1972).
So with out changing any information and just updating the customer record repeatedly, the DOB will alternatively save as 07/02/1972 and 02/07/1972.
What needs to be changed to update and display the DOB in the format DDMMYYYY?