Bug 218438

Summary: strftime("%x") wrong with cs_CZ locale
Product: [Fedora] Fedora Reporter: Jan "Yenya" Kasprzak <kas>
Component: glibcAssignee: Jakub Jelinek <jakub>
Status: CLOSED RAWHIDE QA Contact: Brian Brock <bbrock>
Severity: low Docs Contact:
Priority: medium    
Version: 6CC: vladimir.michl
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 2.5.90-11 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-12-06 17:49:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
glibc-cs_CZ-d_fmt.patch
none
glibc-cs_CZ-d_fmt.patch none

Description Jan "Yenya" Kasprzak 2006-12-05 11:36:07 UTC
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):
glibc-2.5-3

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

Actual results:
05.12.2006

Expected results:
5.12.2006

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 12:26:47 UTC
Created attachment 142830 [details]
glibc-cs_CZ-d_fmt.patch

Fix.  Though, I believe we need Vladimir.Michl's ack for this first.

Comment 2 Jakub Jelinek 2006-12-05 12:35:19 UTC
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 13:13:27 UTC
Hi,

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
forms.

So I agree with Jakub to change it to %-d.%-m.%Y.

Comment 4 Jakub Jelinek 2006-12-05 13:24:30 UTC
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 13:42:47 UTC
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 13:59:04 UTC
Created attachment 142843 [details]
glibc-cs_CZ-d_fmt.patch

Updated patch.

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