Setting date format for Australia
Posted: Thu Jul 10, 2025 10:41 pm
I want to display short dates in admin as d/m/Y
In english.php I had
However short dates (i.e. on admin/customers.php) dates were shown as m/d/y
Changing IntlDateFormatter locale to en_AU fixed it.
Set in includes/languages/english.php and admin/includes/languages/english.php
In english.php I had
Code: Select all
setlocale(LC_ALL, ['en_AU.UTF-8', 'en_AU.UTF8', 'ena_au']);
$long_date_formatter = new IntlDateFormatter('en', IntlDateFormatter::FULL, IntlDateFormatter::NONE);
$short_date_formatter = new IntlDateFormatter('en', IntlDateFormatter::SHORT, IntlDateFormatter::NONE);
$date_time_formatter = new IntlDateFormatter('en', IntlDateFormatter::SHORT, IntlDateFormatter::LONG);
Changing IntlDateFormatter locale to en_AU fixed it.
Code: Select all
setlocale(LC_ALL, ['en_AU.UTF-8', 'en_AU.UTF8', 'ena_au']);
$long_date_formatter = new IntlDateFormatter('en_AU', IntlDateFormatter::FULL, IntlDateFormatter::NONE);
$short_date_formatter = new IntlDateFormatter('en_AU', IntlDateFormatter::SHORT, IntlDateFormatter::NONE);
$date_time_formatter = new IntlDateFormatter('en_AU', IntlDateFormatter::SHORT, IntlDateFormatter::LONG);