Totally Zenned
- Join Date:
- Sep 2005
- Location:
- Waikato, New Zealand
- Posts:
- 1,558
- Plugin Contributions:
- 1
Changing Date Format in 1.54 to UK
First off, i have changed the date format from US to the UK version many many times in older versions of zencart
https://www.zen-cart.com/showthread.php?57548-How-do-I-change-the-Date-format
But in version 1.54 the specific block of code is slightly different and I don't really know why and what the effect of me changing it the way i used to would do
includes/languages/english.php
Old code
@setlocale(LC_TIME, 'en_US.ISO_8859-1');
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');
The new code
// look in your $PATH_LOCALE/locale directory for available locales..
$locales = array('en_US', 'en_US.utf8', 'en', 'English_United States.1252');
@setlocale(LC_TIME, $locales);
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');
The last 4 lines are identical in both, not a problem,
however it is the conversion of the first line in the old code
@setlocale(LC_TIME, 'en_US.ISO_8859-1');
that becomes two lines in the newer code, how do I Anglicise that
$locales = array('en_US', 'en_US.utf8', 'en', 'English_United States.1252');
@setlocale(LC_TIME, $locales);
becomes what in English UK , and will the change to UTF8 effect anything if my database has been imported from an older version
Thanks
Webzings Design
Semi retired from Web Design