From patchwork Wed Jul 8 21:13:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos O'Donell X-Patchwork-Id: 39987 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0DA543858D35; Wed, 8 Jul 2020 21:14:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0DA543858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1594242842; bh=NzduKv76XAW74hIcObucqYt4kUBRE8qXeZouUOaZgGc=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=utsq28IxRzwze53Kcp87lMsWQ/CGT9Bkj2HfuHpoZDWHI181q2mYfzQDbPTxPO1C3 R2GWKQnekgtkGJoTXIFlIHyXd1X264OnJIdsSFFsmtrtYzVPGlKWkP2x6uEwbI34Ty c99D+2xWrTpiN2ZB4CHpUdH7qz4b7VYxHqUr1K6w= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by sourceware.org (Postfix) with ESMTP id 02F863858D34 for ; Wed, 8 Jul 2020 21:13:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 02F863858D34 Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-139-qyecA_KCPkietH2LDpkLZw-1; Wed, 08 Jul 2020 17:13:53 -0400 X-MC-Unique: qyecA_KCPkietH2LDpkLZw-1 Received: by mail-qt1-f198.google.com with SMTP id c26so79914qtq.6 for ; Wed, 08 Jul 2020 14:13:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:organization:message-id:date :user-agent:mime-version:content-language:content-transfer-encoding; bh=NzduKv76XAW74hIcObucqYt4kUBRE8qXeZouUOaZgGc=; b=WUmlJ25qz/mNIPkjb47+G0CNfrWEbAcwqPt1Tf84aPrygBaYRwtSQrYZOMCEiWmyvt sG1dUzXWe6FSWHMHW9JNsJbxrI+OFIpBKFRVXNxlDqIooEUHX+tOpr+hk1rvRuRSGrn3 LShWUnKvpibQg426/ReynX2VUmSCuaK/uXJrkqWt7ZfX8OkQxsJXaSVx9tL14gWJxGZN D5N9Sd/km8vshFGAED8At+VUVbptySJcZAzOCnAEXBq2wrU7uB3Pbtc5kBzaSaFhZQcd lAvj4SOmsiJBhY3OM71uXc8yshSe7demVuaZdEYsTN7qGEWHFBgMtsUrDDe6sTSjFbq2 90UQ== X-Gm-Message-State: AOAM533Arv/+Jzjp7hM+P8+ElaDZJlkh8uc67lcZdk9vj8S14tSulRWW TAwI0Ql+GYT14cVk9uaVpQ1Lvflzl4lMb9T9hhIzkOr9nYbz9xJZrDlzQJ30k1YbY5iRP8QWSqi 3wOZ427ZhTBssQKRNpnO1 X-Received: by 2002:a37:a753:: with SMTP id q80mr45326567qke.461.1594242832998; Wed, 08 Jul 2020 14:13:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLl0KIOZFinKJj27c8keqH3LWXehXpVQlHxWfFMv7E2sAced6qiAGtGq2W58NL8XDjLVX75A== X-Received: by 2002:a37:a753:: with SMTP id q80mr45326539qke.461.1594242832599; Wed, 08 Jul 2020 14:13:52 -0700 (PDT) Received: from [192.168.1.4] (198-84-170-103.cpe.teksavvy.com. [198.84.170.103]) by smtp.gmail.com with ESMTPSA id i10sm1535978qkn.126.2020.07.08.14.13.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Jul 2020 14:13:51 -0700 (PDT) To: libc-alpha , Rafal Luzynski , Aurelien Jarno , Mike Fabian , "Andreas K. Huettel" Subject: [PATCH] en_US: Minimize changes to date_fmt (Bug 25923) Organization: Red Hat Message-ID: <12762a4a-ada3-616a-1a16-98969e70bae4@redhat.com> Date: Wed, 8 Jul 2020 17:13:50 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 Content-Language: en-US X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, HEXHASH_WORD, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Carlos O'Donell via Libc-alpha From: Carlos O'Donell Reply-To: Carlos O'Donell Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" This patch implements the fix for bug 25923, which is to minimize the changes made by commit 7395f3a0efad9fc51bb54fa383ef6524702e0c49. This includes swapping the month and day, and moving the year to the end. env LANG=en_US.UTF-8 \ GCONV_PATH=/home/carlos/build/glibc-review/iconvdata \ LOCPATH=/home/carlos/build/glibc-review/localedata \ date Wed Jul 8 04:35:20 PM EDT 2020 $ date Wed 08 Jul 2020 04:35:21 PM EDT Andreas, I see that you did comment on this in 2019-03-29: https://sourceware.org/bugzilla/show_bug.cgi?id=24046#c4 In the future if such issues that you notice are affecting your users, please raise them upstream. I pondered a bit the parse-ability of %e vs. %b, and settled on the fact that a space-padded day of the month is easier to split out and is what was originally present. On the topic of d_t_fmt, I think the existing format in glibc is not what US users want, but given that it's been present since 1997 I would never want to change it without a very strong justification. In the case of date_fmt, it was specifically designed to allow users to control date's output. Even then date_fmt is an undocumented value to be used with nl_langinfo and requires reading headers and using _DATE_FMT or _NL_W_DATE_FMT (wide char?). Thus I am ok with the 24H to 12H change from 2019, and any script that wants a specific format should be using it directly with date. OK for glibc 2.32? 8< --- 8< --- 8< In 2000 when date_fmt was originally added as an extension the en_US locale did not have a date_fmt specifier and so used the default which resulted in the abbreviated month name coming before the day of the month (as expected in the US and other locales). In commit 7395f3a0efad9fc51bb54fa383ef6524702e0c49 the date_fmt was added to en_US with a 12H time to better align with US user expectations. Unfortunately the abbreviated month name and day were inverted during that transition, and that was seen as a regression and reported against Fedora 32: https://bugzilla.redhat.com/show_bug.cgi?id=1830623 The progression of date_fmt looks like this: "%a %b %e %H:%M:%S %Z %Y" <- Originally (2000) "%a %d %b %Y %I:%M:%S %p %Z" <- glibc 2.29 (2019) "%a %b %e %r %Z %Y" <- glibc 2.32 (2020) [this commit] Note: "%r" is "%I:%M:%S %p" in en_US and so shorter to write. Likewise the year is in the wrong place in commit 7395f3a0efad9fc51bb54fa383ef6524702e0c49 and this is corrected in this patch. For reference d_t_fmt: "%a %d %b %Y %r %Z" <- d_t_fmt (1997) Yes, d_t_fmt and date_fmt are *not* the same, this is just the history of this locale. This commit does not change d_t_fmt to better align with date_fmt. No users have requested we change d_t_fmt or given any justification for such a change. The only goals of this change are to place the abbreviated month name before the day of the month as it has been printed since 2000, and place the year at the end. This minimizes the change from commit 7395f3a0efad9fc51bb54fa383ef6524702e0c49 and makes good on changing only from 24H clock to 12H clock. --- localedata/locales/en_US | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/localedata/locales/en_US b/localedata/locales/en_US index e71abf5d5c..15c6354fcf 100644 --- a/localedata/locales/en_US +++ b/localedata/locales/en_US @@ -117,8 +117,11 @@ t_fmt "%r" % Appropriate AM/PM time representation (%r) t_fmt_ampm "%I:%M:%S %p" % -% Appropriate date and time representation for date(1) -date_fmt "%a %d %b %Y %r %Z" +% Appropriate date and time representation for date(1). This is +% different from d_t_fmt for historical reasons and has been different +% since 2000 when date_fmt was added as a GNU extension. At the end +% of 2018 it was adjusted to use 12H time (bug 24046) instead of 24H. +date_fmt "%a %b %e %r %Z %Y" % % Strings for AM/PM %