Incorrect date format in en_CA.utf8 locale

Bug #214730 reported by Malcolm Lalkaka
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
GLibC
Fix Released
Medium
langpack-locales (Ubuntu)
Fix Released
Low
Gunnar Hjalmarsson

Bug Description

The date format in /usr/lib/locale/en_CA.utf8/LC_TIME specifies the date format as "%d/%m/%y". (This is also the case if you run the command 'locale LC_TIME' with your locale set to en_CA.utf8.) However, it should be "%y-%m-%d". This is the standard date format in Canada (as specified by the Canadian Standards Association in CSA Z234.5:1989, which adopts the ISO 8601 standard). I noticed this in Ubuntu 7.10.

Tags: patch
Revision history for this message
Ian Weisser (ian-weisser) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. You reported this bug a while ago and there hasn't been any activity in it recently. We were wondering is this still an issue for you? Can you try with latest Ubuntu release? Thanks in advance.

Revision history for this message
Malcolm Lalkaka (mlalkaka) wrote :

Hello. Yes, I tried this in Ubuntu 8.04, and the result is the same.

Changed in langpack-locales:
status: Incomplete → New
Revision history for this message
Malcolm Lalkaka (mlalkaka) wrote :

Here's the web page from the National Research Council of Canada citing ISO 8601 as the standard date/time format in Canada, by the way: http://inms-ienm.nrc-cnrc.gc.ca/faq_time_e.html#Q8.

Martin Pitt (pitti)
Changed in langpack-locales:
assignee: nobody → pitti
status: New → In Progress
Revision history for this message
In , Martin Pitt (pitti) wrote :

From https://launchpad.net/bugs/214730:

The date format in /usr/lib/locale/en_CA.utf8/LC_TIME specifies the date format
as "%d/%m/%y". (This is also the case if you run the command 'locale LC_TIME'
with your locale set to en_CA.utf8.) However, it should be "%y-%m-%d". This is
the standard date format in Canada (as specified by the Canadian Standards
Association in CSA Z234.5:1989, which adopts the ISO 8601 standard).

Here's the web page from the National Research Council of Canada citing ISO 8601
as the standard date/time format in Canada, by the way:
http://inms-ienm.nrc-cnrc.gc.ca/faq_time_e.html#Q8.

Revision history for this message
Martin Pitt (pitti) wrote :

Forwarded upstream. This should be ack'ed by upstream first, so that we don't unnecessarily deviate from other distros, and other distributions benfit from the fixes as well.

Changed in langpack-locales:
status: In Progress → Triaged
assignee: pitti → nobody
Changed in glibc:
status: Unknown → Confirmed
Revision history for this message
In , Martin Pitt (pitti) wrote :

Created attachment 3762
patch

Revision history for this message
Martin Pitt (pitti) wrote :

Patch created and sent upstream.

Changed in langpack-locales:
assignee: nobody → pitti
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package langpack-locales - 2.9+cvs20090214-5

---------------
langpack-locales (2.9+cvs20090214-5) jaunty; urgency=low

  * Add debian/local/txt2unicode.py: Script to convert an unicode
    string into the <Uxxxx> format used in locale definitions.
  * Add mt_MT-Awwissu-spelling.patch: Fix Maltese spelling of *
    "Awwissu" (August). (LP: #262133)
  * Add en_CA-dateformat.patch: en_CA date format should be "%y-%m-%d"
    (see http://inms-ienm.nrc-cnrc.gc.ca/faq_time_e.html#Q8).
    (LP: #214730)

 -- Martin Pitt <email address hidden> Tue, 24 Feb 2009 17:29:59 +0100

Changed in langpack-locales:
status: Fix Committed → Fix Released
Revision history for this message
In , Drepper-fsp (drepper-fsp) wrote :

I very much doubt this would go over well. Yes, it is the proposed format. But
the locale information is what people expect. And I suspect they expect the
current format especially since the US format isn't going to change any time soon.

Changed in glibc:
status: Confirmed → Won't Fix
Changed in langpack-locales (Ubuntu):
status: Fix Released → Confirmed
status: Confirmed → Fix Released
Changed in glibc:
importance: Unknown → Medium
Revision history for this message
dankm (dan-mcgregor) wrote :

The correct date format should be %Y-%m-%d. %y-%m-%d gives a two digit year, when ISO8601 specifies a four digit year.

information type: Public → Public Security
Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

On 2014-09-09 17:51, danno_mac wrote:
> The correct date format should be %Y-%m-%d.

And it is in Ubuntu since several years, and this bug report is closed.

$ LANG=en_CA.UTF-8 locale d_fmt
%Y-%m-%d

information type: Public Security → Public
Revision history for this message
dankm (dan-mcgregor) wrote :

I realise the bug report is closed, but what got put in is not %Y-%m-%d. It is %y-%m-%d.

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.1 LTS"
$ LANG=en_CA.UTF-8 locale d_fmt
%y-%m-%d
$ LANG=fr_CA.UTF-8 locale d_fmt
%Y-%m-%d

Should I open a new bug?

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

Sorry, my mistake. I have LC_TIME set explicitly (to the Swedish locale), so I should have done:

$ LC_TIME=en_CA.UTF-8 locale d_fmt
%y-%m-%d

which proves you are right.

Normally you should file a new bug, but it appears to me that they made a mistake 5 years ago, so let's say this is a correction of that fix. ;)

Reopening.

Changed in langpack-locales (Ubuntu):
assignee: Martin Pitt (pitti) → Gunnar Hjalmarsson (gunnarhj)
importance: Undecided → Low
status: Fix Released → In Progress
Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :
tags: added: patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package langpack-locales - 2.13+git20120306-14

---------------
langpack-locales (2.13+git20120306-14) utopic; urgency=low

  * debian/patches/ubuntu-en_CA-dateformat.patch:
    Change d_fmt from 2-digit to 4-digit year (LP: #214730).
 -- Gunnar Hjalmarsson <email address hidden> Wed, 10 Sep 2014 01:12:00 +0200

Changed in langpack-locales (Ubuntu):
status: In Progress → Fix Released
Changed in glibc:
status: Won't Fix → Fix Released
Revision history for this message
Jean-Sebastien Dominique (tehwan) wrote :

Several years later, the en_CA package still shows date as %d/%m/%y

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.1 LTS"

$ LANG=en_CA.UTF-8 locale d_fmt
%d/%m/%y

Was there a regression?

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

On 2020-10-19 17:32, Jean-Sebastien Dominique wrote:
> Several years later, the en_CA package still shows date as %d/%m/%y

No it doesn't.

$ LC_TIME=en_CA.UTF-8 locale d_fmt
%Y-%m-%d

Revision history for this message
Jean-Sebastien Dominique (tehwan) wrote :

Hmm, you are indeed correct. For some reason, my LC_TIME is set to en_GB and I have no idea why. Everything else is set to en_CA. Sorry about that. I recently updated to KDE Plasma 5 and I'm having so many issues with locale ever since. Sorry again!

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

KDE does have issues with locale settings, unfortunately. Have had for several years now.

Maybe try https://askubuntu.com if you don't figure it out yourself.

Revision history for this message
Jean-Sebastien Dominique (tehwan) wrote :

Thanks. I did fix it. The only thing left is the 12-hour time, but that's sadly in the locale (%r). It should really be 24-hour time, which is what we mostly use in Canada (and the official time is in 24-hour format), despite 12-hour time being tolerated. At least KDE lets me force that to 24-hour time, so I'm set on that end.

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

There is an upstream bug where the time format aspect is still open:

https://sourceware.org/bugzilla/show_bug.cgi?id=16668

Please feel free to add a comment to speed it up. :)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.