Bug 24054 - Many locales are missing date_fmt
Summary: Many locales are missing date_fmt
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: localedata (show other bugs)
Version: 2.29
: P2 normal
Target Milestone: 2.31
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-02 17:41 UTC by Aurelien Jarno
Modified: 2020-01-02 10:53 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aurelien Jarno 2019-01-02 17:41:11 UTC
date_fmt is used by the date(1) utility. Many locales do not define it, in which case it defaults to "%a %b %e %H:%M:%S %Z %Y". This is bad for many of them because this assumes the date order is MDY which is not the most popular order around the world.
Comment 1 cvs-commit@gcc.gnu.org 2020-01-02 10:52:06 UTC
The master branch has been updated by Rafal Luzynski <rl@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=75ba929987f6950dd008ef0f6270f1b21e9af511

commit 75ba929987f6950dd008ef0f6270f1b21e9af511
Author: Rafał Lużyński <digitalfreak@lingonborough.com>
Date:   Mon Dec 30 11:58:18 2019 +0100

    Multiple locales: Add date_fmt (bug 24054)
    
    It is not specified what should be the content of d_t_fmt and date_fmt
    but in the built-in C locale those fields have only one difference:
    date_fmt contains "%Z" (the current time zone) while d_t_fmt does not.
    
    For most of the locales this commit does the following operation:
    copy d_t_fmt to date_fmt, and then remove "%Z" from d_t_fmt.
    If "%Z" was originally missing from d_t_fmt add it to date_fmt.
    It also corrects comments where necessary.
    
    Exceptions:
    
    * In bo_CN, dz_BT, and km_KH "%Z" has not been added to date_fmt because
      it was too difficult.  In these locales date_fmt has been set to the
      copy of d_t_fmt.
    * In en_DK "%Z" has not been removed from d_t_fmt in order to preserve
      the conformance with the standard mentioned in the comment.
    
    The command to identify and initially edit the locales that need the
    update was:
    
        for i in `grep -lw d_t_fmt *`
        do
            if ! grep -qw date_fmt $i ; then
                awk '/d_t_fmt/ { print $0; gsub("d_t_fmt", "date_fmt"); } //{ print $0 }' < $i > $i.next
                mv $i.next $i
            fi
        done
    
    and then each file was further edited manually.