I have a requirement to change the order of DD/MM/YYYY tags according to a users country .
http://en.wikipedia.org/wiki/Date_format_by_country
The way that I was
if you use PHP then the IntlDateFormatter() helps you out:
$d = new DateTime();
$fmt = new IntlDateFormatter('en-US', IntlDateFormatter::SHORT, IntlDateFormatter::NONE);
echo "US: ".$fmt->format($d)."
";
$fmt = new IntlDateFormatter('en-GB', IntlDateFormatter::SHORT, IntlDateFormatter::NONE);
echo "GB: ".$fmt->format($d)."
";
$fmt = new IntlDateFormatter('en-AU', IntlDateFormatter::SHORT, IntlDateFormatter::NONE);
echo "AU: ".$fmt->format($d)."
";
$fmt = new IntlDateFormatter('de-DE', IntlDateFormatter::SHORT, IntlDateFormatter::NONE);
echo "DE: ".$fmt->format($d)."
";
Output:
US: 2/1/18
GB: 01/02/2018
AU: 1/2/18
DE: 01.02.18