Bug 218438 - strftime("%x") wrong with cs_CZ locale
strftime("%x") wrong with cs_CZ locale
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
All Linux
medium Severity low
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2006-12-05 06:36 EST by Jan "Yenya" Kasprzak
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version: 2.5.90-11
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-12-06 12:49:59 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
glibc-cs_CZ-d_fmt.patch (696 bytes, patch)
2006-12-05 07:26 EST, Jakub Jelinek
no flags Details | Diff
glibc-cs_CZ-d_fmt.patch (1022 bytes, patch)
2006-12-05 08:59 EST, Jakub Jelinek
no flags Details | Diff

  None (edit)
Description Jan "Yenya" Kasprzak 2006-12-05 06:36:07 EST
Description of problem:
the "%x" date formatting string of strftime(3) or date(1) is incorrect for the
Czech locale (cs_CZ.UTF-8) - the output should not contain leading zeros.

Version-Release number of selected component (if applicable):

Steps to Reproduce:
1. run "LC_ALL=cs_CZ.UTF-8 date +%x"

Actual results:

Expected results:

Additional info:
the Czech locale should not use leading zeros for the day or month number.
It seems the "%c" formating string is correct:

$ LC_ALL=cs_CZ.UTF-8 date +%c
Út  5. prosinec 2006, 12:33:21 CET
Comment 1 Jakub Jelinek 2006-12-05 07:26:47 EST
Created attachment 142830 [details]

Fix.  Though, I believe we need Vladimir.Michl@upol.cz's ack for this first.
Comment 2 Jakub Jelinek 2006-12-05 07:35:19 EST
The month number still has leading zero, say 5.01.2006.
Wonder if d_fmt shouldn't be %e.%_m.%Y or %_d.%_m.%Y or even %-d.%-m.%Y
(I think the last one matches most the common usage, but I might be wrong).
Comment 3 Vladimir Michl 2006-12-05 08:13:27 EST

probably the last option, that Jakub suggests %-d.%-m.%Y is the most common one
to use.

I think, the currect version (%d.%m.%Y) is acceptable as in computer generated

So I agree with Jakub to change it to %-d.%-m.%Y.
Comment 4 Jakub Jelinek 2006-12-05 08:24:30 EST
Similarly, for d_t_fmt, should we use %e or %-d?  I believe there the
decision is easier, the month names have variable lengths and two spaces
between day name and day of month for 1. through 9. look very ugly.
It seems strftime can't do what we really would want to do for %c though,
perticularly use different form of the full month name, we want
Ut 5. prosince 2006, 12:33:21 CET rather than Ut, 5. prosinec 2006, 12:33:21 CET.
Not sure if we could abuse %EB for this, certainly it would mean a strftime
extension and also extending LC_TIME locale format to store the alternate
forms of month names.
Comment 5 Jan "Yenya" Kasprzak 2006-12-05 08:42:47 EST
I am for %-d here.

As for the month name variant, it would be nice to have the alternative month
names for %c, whith %EB as a repository for the alternative month names.

BTW, can the time zone names be localized as well? The "CET" name also does not
look good when embedded into the Czech text. SEČ/SELČ would definitely be better
than CET/CEST.
Comment 6 Jakub Jelinek 2006-12-05 08:59:04 EST
Created attachment 142843 [details]

Updated patch.
Comment 7 Jakub Jelinek 2006-12-06 12:49:59 EST
This patch is now in CVS and glibc-2.5.90-11 in rawhide.

Note You need to log in before you can comment on or make changes to this bug.