Bug 2000374

Summary: glibc: Provide English-language locale with 12-hour time
Product: Red Hat Enterprise Linux 8 Reporter: Chris Cheney <ccheney>
Component: glibcAssignee: Patsy Griffin <pfrankli>
Status: CLOSED ERRATA QA Contact: Sergey Kolosov <skolosov>
Severity: medium Docs Contact: Petr Hybl <phybl>
Priority: medium    
Version: 8.4CC: ashankar, codonell, dj, fweimer, jvaldez, mnewsome, pfrankli, phybl, sipoyare
Target Milestone: rcKeywords: FutureFeature, Reopened, Triaged
Target Release: 8.6   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: glibc-2.28-173.el8 Doc Type: Enhancement
Doc Text:
.New UTF-8 locale `en_US@ampm` with 12-hour clock With this update, you can now use a new UTF-8 locale `en_US@ampm` with a 12-hour clock. This new locale can be combined with other locales by using the `LC_TIME` environment variable.
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-10 15:17:47 UTC Type: Enhancement
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Chris Cheney 2021-09-02 02:46:02 UTC
glibc 2.28 in RHEL 8 has a bug that causes 24 hour time to be used in the US.

Instead of using the correct date format RHEL 8 is using the default, which is 24h time:

   "%a %b %e %H:%M:%S %Z %Y"

It should be:

   "%a %b %e %r %Z %Y""


So instead of displaying:

   Wed Sep  1 21:44:02 CDT 2021

It should display:

   Wed Sep  1 09:44:02 PM CDT 2021


This was already fixed in upstream glibc with the following BZs and patches:

   en_US locale doesn't define date_fmt
   https://sourceware.org/bugzilla/show_bug.cgi?id=24046

   Regression: en_US date_fmt and d_t_fmt and "%a %d %b" vs. "%a %b %e"
   https://sourceware.org/bugzilla/show_bug.cgi?id=25923

These patches appear to fix the issue for en_US:

   https://github.com/bminor/glibc/commit/7395f3a0efad9fc51bb54fa383ef6524702e0c49
   https://github.com/bminor/glibc/commit/8cde977077b3568310c743b21a905ca9ab286724

Comment 2 Florian Weimer 2021-09-02 08:10:01 UTC
We do not make such changes to widely used locales after the release of the product because it would rather surprising. For example, it could affect the format of log files, so that automation no longer can parse them after the change.

I suspect the customer is looking for an option to change the desktop clock to 24 hour format. I expect there are different ways to achieve this that do not involve changing the definition of the en_US.utf8 locale.

Comment 8 Florian Weimer 2021-09-06 10:27:07 UTC
We should add at least one 12-hour locale that can be combined with English-language locales, by setting LC_TIME. No such locale exists right now.

Comment 19 errata-xmlrpc 2022-05-10 15:17:47 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (glibc bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:2005