From unknown Sun Aug 17 00:58:59 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34608: date +%+4C is unimplemented, contrary to POSIX Resent-From: Eric Blake Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Thu, 21 Feb 2019 17:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 34608 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 34608@debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.155076902323857 (code B ref -1); Thu, 21 Feb 2019 17:11:02 +0000 Received: (at submit) by debbugs.gnu.org; 21 Feb 2019 17:10:23 +0000 Received: from localhost ([127.0.0.1]:59790 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gwrra-0006Ci-Pn for submit@debbugs.gnu.org; Thu, 21 Feb 2019 12:10:23 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44031) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gwrrZ-0006CV-5e for submit@debbugs.gnu.org; Thu, 21 Feb 2019 12:10:21 -0500 Received: from lists.gnu.org ([209.51.188.17]:59553) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gwrrT-0004lD-Rw for submit@debbugs.gnu.org; Thu, 21 Feb 2019 12:10:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58390) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gwrrN-000868-Lm for bug-coreutils@gnu.org; Thu, 21 Feb 2019 12:10:15 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gwrrM-0004gz-Rc for bug-coreutils@gnu.org; Thu, 21 Feb 2019 12:10:09 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41532) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gwrrM-0004gY-Kc for bug-coreutils@gnu.org; Thu, 21 Feb 2019 12:10:08 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BB2B9307D8F4 for ; Thu, 21 Feb 2019 17:10:07 +0000 (UTC) Received: from [10.3.116.222] (ovpn-116-222.phx2.redhat.com [10.3.116.222]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 90238282D0 for ; Thu, 21 Feb 2019 17:10:07 +0000 (UTC) From: Eric Blake Organization: Red Hat, Inc. Message-ID: <2d7755c4-d5eb-db3a-f7cc-37ff97ddfcb9@redhat.com> Date: Thu, 21 Feb 2019 11:10:06 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Thu, 21 Feb 2019 17:10:07 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: 0.9 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) POSIX requires the '+' flag in %C to output padding with leading 0, and additionally to add a +/- indicator if the minimum field width is larger than 2 bytes. Thus: date -d 0001-01-01 +.%+4C. should produce ".+000.", but currently it produces ".%+4C." because the + flag is unimplemented. See also http://austingroupbugs.net/view.php?id=1184 -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org From unknown Sun Aug 17 00:58:59 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34608: date +%+4C is unimplemented, contrary to POSIX Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 22 Feb 2019 03:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34608 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Eric Blake Cc: 34608@debbugs.gnu.org Received: via spool by 34608-submit@debbugs.gnu.org id=B34608.155080667917743 (code B ref 34608); Fri, 22 Feb 2019 03:38:01 +0000 Received: (at 34608) by debbugs.gnu.org; 22 Feb 2019 03:37:59 +0000 Received: from localhost ([127.0.0.1]:47501 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gx1ew-0004c7-Pp for submit@debbugs.gnu.org; Thu, 21 Feb 2019 22:37:59 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:42216) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gx1es-0004bo-3k for 34608@debbugs.gnu.org; Thu, 21 Feb 2019 22:37:57 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 5CA29161387; Thu, 21 Feb 2019 19:37:47 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id j4QHUwQ1gCUM; Thu, 21 Feb 2019 19:37:46 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 855E2161402; Thu, 21 Feb 2019 19:37:46 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 2wxKAPUsTWPH; Thu, 21 Feb 2019 19:37:46 -0800 (PST) Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com [23.242.74.103]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 61D10161344; Thu, 21 Feb 2019 19:37:46 -0800 (PST) References: <2d7755c4-d5eb-db3a-f7cc-37ff97ddfcb9@redhat.com> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <03515f25-00f5-dd17-8a77-86efc0d604c8@cs.ucla.edu> Date: Thu, 21 Feb 2019 19:37:46 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <2d7755c4-d5eb-db3a-f7cc-37ff97ddfcb9@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Eric Blake wrote: > date -d 0001-01-01 +.%+4C. > > should produce ".+000.", but currently it produces ".%+4C." because the > + flag is unimplemented. > > See also http://austingroupbugs.net/view.php?id=1184 Surely this bug should be reported against strftime, not against 'date'. POSIX does require that strftime behave that way, but it does not place a similar requirement on 'date'. From unknown Sun Aug 17 00:58:59 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34608: date +%+4C is unimplemented, contrary to POSIX Resent-From: Eric Blake Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 22 Feb 2019 03:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34608 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Paul Eggert Cc: 34608@debbugs.gnu.org Received: via spool by 34608-submit@debbugs.gnu.org id=B34608.155080682717994 (code B ref 34608); Fri, 22 Feb 2019 03:41:01 +0000 Received: (at 34608) by debbugs.gnu.org; 22 Feb 2019 03:40:27 +0000 Received: from localhost ([127.0.0.1]:47507 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gx1hL-0004g9-Dt for submit@debbugs.gnu.org; Thu, 21 Feb 2019 22:40:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57394) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gx1hJ-0004fx-Q3 for 34608@debbugs.gnu.org; Thu, 21 Feb 2019 22:40:26 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D952B3091740; Fri, 22 Feb 2019 03:40:19 +0000 (UTC) Received: from [10.3.116.222] (ovpn-116-222.phx2.redhat.com [10.3.116.222]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9B22E5C290; Fri, 22 Feb 2019 03:40:19 +0000 (UTC) References: <2d7755c4-d5eb-db3a-f7cc-37ff97ddfcb9@redhat.com> <03515f25-00f5-dd17-8a77-86efc0d604c8@cs.ucla.edu> From: Eric Blake Organization: Red Hat, Inc. Message-ID: <9e16ba9a-16cc-6090-c7a2-7cc806000415@redhat.com> Date: Thu, 21 Feb 2019 21:40:18 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <03515f25-00f5-dd17-8a77-86efc0d604c8@cs.ucla.edu> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Fri, 22 Feb 2019 03:40:19 +0000 (UTC) X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) On 2/21/19 9:37 PM, Paul Eggert wrote: > Eric Blake wrote: > >> date -d 0001-01-01 +.%+4C. >> >> should produce ".+000.", but currently it produces ".%+4C." because the >> + flag is unimplemented. >> >> See also http://austingroupbugs.net/view.php?id=1184 > > Surely this bug should be reported against strftime, not against 'date'. > POSIX does require that strftime behave that way, but it does not place > a similar requirement on 'date'. > That used to be true, but now POSIX wants date to behave as if it uses strftime: http://austingroupbugs.net/view.php?id=466 -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org From unknown Sun Aug 17 00:58:59 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34608: date +%+4C is unimplemented, contrary to POSIX Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 22 Feb 2019 04:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34608 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Eric Blake Cc: 34608@debbugs.gnu.org Received: via spool by 34608-submit@debbugs.gnu.org id=B34608.155080809220065 (code B ref 34608); Fri, 22 Feb 2019 04:02:02 +0000 Received: (at 34608) by debbugs.gnu.org; 22 Feb 2019 04:01:32 +0000 Received: from localhost ([127.0.0.1]:47511 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gx21k-0005DZ-8w for submit@debbugs.gnu.org; Thu, 21 Feb 2019 23:01:32 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:44196) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gx21h-0005DK-Bk for 34608@debbugs.gnu.org; Thu, 21 Feb 2019 23:01:30 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id D8A7B161382; Thu, 21 Feb 2019 20:01:22 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id ybcGZRWdKZ8X; Thu, 21 Feb 2019 20:01:22 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 09CBC16139F; Thu, 21 Feb 2019 20:01:22 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id J8CfAZKmCxPD; Thu, 21 Feb 2019 20:01:21 -0800 (PST) Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com [23.242.74.103]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id CDA831612D0; Thu, 21 Feb 2019 20:01:21 -0800 (PST) References: <2d7755c4-d5eb-db3a-f7cc-37ff97ddfcb9@redhat.com> <03515f25-00f5-dd17-8a77-86efc0d604c8@cs.ucla.edu> <9e16ba9a-16cc-6090-c7a2-7cc806000415@redhat.com> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <1be57592-8e21-c39e-d14d-4082841d4f43@cs.ucla.edu> Date: Thu, 21 Feb 2019 20:01:21 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <9e16ba9a-16cc-6090-c7a2-7cc806000415@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Eric Blake wrote: > That used to be true, but now POSIX wants date to behave as if it uses > strftime: > > http://austingroupbugs.net/view.php?id=466 Ah, I didn't know that. Is there a list of recent changes to the POSIX spec for strftime somewhere? I can look to see which of them have made their way into Gnulib nstrftime. From unknown Sun Aug 17 00:58:59 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34608: date +%+4C is unimplemented, contrary to POSIX Resent-From: Eric Blake Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 22 Feb 2019 15:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34608 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Paul Eggert Cc: 34608@debbugs.gnu.org Received: via spool by 34608-submit@debbugs.gnu.org id=B34608.155084886127557 (code B ref 34608); Fri, 22 Feb 2019 15:22:01 +0000 Received: (at 34608) by debbugs.gnu.org; 22 Feb 2019 15:21:01 +0000 Received: from localhost ([127.0.0.1]:48480 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gxCdI-0007A0-Ua for submit@debbugs.gnu.org; Fri, 22 Feb 2019 10:21:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:32856) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gxCdH-00079m-Qi for 34608@debbugs.gnu.org; Fri, 22 Feb 2019 10:21:00 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3D32BC049D67; Fri, 22 Feb 2019 15:20:54 +0000 (UTC) Received: from [10.3.116.222] (ovpn-116-222.phx2.redhat.com [10.3.116.222]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 044581001E99; Fri, 22 Feb 2019 15:20:53 +0000 (UTC) References: <2d7755c4-d5eb-db3a-f7cc-37ff97ddfcb9@redhat.com> <03515f25-00f5-dd17-8a77-86efc0d604c8@cs.ucla.edu> <9e16ba9a-16cc-6090-c7a2-7cc806000415@redhat.com> <1be57592-8e21-c39e-d14d-4082841d4f43@cs.ucla.edu> From: Eric Blake Organization: Red Hat, Inc. Message-ID: <4ed94da6-93f6-0621-0f7c-6b5b3de40ea9@redhat.com> Date: Fri, 22 Feb 2019 09:20:53 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <1be57592-8e21-c39e-d14d-4082841d4f43@cs.ucla.edu> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 22 Feb 2019 15:20:54 +0000 (UTC) X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) On 2/21/19 10:01 PM, Paul Eggert wrote: > Eric Blake wrote: >> That used to be true, but now POSIX wants date to behave as if it uses >> strftime: >> >> http://austingroupbugs.net/view.php?id=466 > > Ah, I didn't know that. Is there a list of recent changes to the POSIX > spec for strftime somewhere? I can look to see which of them have made > their way into Gnulib nstrftime. The best I can do is search austingroupbugs.net for all bugs containing strftime, which pulls up a current total of 25 issues. Some are still open or marked as rejected, some are editorial only, and some already were applied in 2008, so the actual list of more recent changes is smaller. But reading through them, I think this is a fair summary: 1184: %C padding (for years below 1000, when minimum width is not specified, it must be treated as width 2 with 0 padding) 1166: Need %OB (similar to %Ob) for nominative vs. genitive month names 954: %s for seconds since Epoch 739 (still not resolved): Whether %F implies plain %C or %+4C 772 (still open): Specifying %:::z and friends, but still at odds with Finland wanting a way to express UTC+3 instead of UTC+03 472: details on %+C 466: date(1) should behave as if it uses strftime(3) 258: Need %Ob for nominative vs. genitive month names -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org From unknown Sun Aug 17 00:58:59 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Eric Blake Subject: bug#34608: closed (Re: bug#34608: date +%+4C is unimplemented, contrary to POSIX) Message-ID: References: <2d7755c4-d5eb-db3a-f7cc-37ff97ddfcb9@redhat.com> X-Gnu-PR-Message: they-closed 34608 X-Gnu-PR-Package: coreutils Reply-To: 34608@debbugs.gnu.org Date: Mon, 25 Feb 2019 08:29:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1551083342-4644-1" This is a multi-part message in MIME format... ------------=_1551083342-4644-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #34608: date +%+4C is unimplemented, contrary to POSIX which was filed against the coreutils package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 34608@debbugs.gnu.org. --=20 34608: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D34608 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1551083342-4644-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 34608-done) by debbugs.gnu.org; 25 Feb 2019 08:28:02 +0000 Received: from localhost ([127.0.0.1]:50807 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gyBcE-0001BM-T9 for submit@debbugs.gnu.org; Mon, 25 Feb 2019 03:28:02 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:39894) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gyBcC-0001B7-7w for 34608-done@debbugs.gnu.org; Mon, 25 Feb 2019 03:27:57 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 0C7C31613F7; Mon, 25 Feb 2019 00:27:50 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id FtjJVmnr6AHZ; Mon, 25 Feb 2019 00:27:48 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 8BAFB161415; Mon, 25 Feb 2019 00:27:48 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 7fhwmGo_Wegs; Mon, 25 Feb 2019 00:27:48 -0800 (PST) Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com [23.242.74.103]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 5BDEC1613F7; Mon, 25 Feb 2019 00:27:48 -0800 (PST) Subject: Re: bug#34608: date +%+4C is unimplemented, contrary to POSIX To: Eric Blake References: <2d7755c4-d5eb-db3a-f7cc-37ff97ddfcb9@redhat.com> <03515f25-00f5-dd17-8a77-86efc0d604c8@cs.ucla.edu> <9e16ba9a-16cc-6090-c7a2-7cc806000415@redhat.com> <1be57592-8e21-c39e-d14d-4082841d4f43@cs.ucla.edu> <4ed94da6-93f6-0621-0f7c-6b5b3de40ea9@redhat.com> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: Date: Mon, 25 Feb 2019 00:27:47 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <4ed94da6-93f6-0621-0f7c-6b5b3de40ea9@redhat.com> Content-Type: multipart/mixed; boundary="------------B07B78200F2B8E0DC3CFAE99" Content-Language: en-US X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 34608-done Cc: 34608-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) This is a multi-part message in MIME format. --------------B07B78200F2B8E0DC3CFAE99 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Eric Blake wrote: > The best I can do is search austingroupbugs.net for all bugs containing > strftime, which pulls up a current total of 25 issues. Thanks for doing that. I read through those issues, and the only one that seems relevant (i.e., resolved by austingroup but not in Gnulib) is the business with the + conversion specification flag. I installed this Gnulib patch to implement the flag: https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=188d87b05190690d6f8b0577ec65ef221a711d08 Then I installed the attached coreutils patches to propagate the Gnulib patch into coreutils, and I am marking this coreutils bug as done. glibc strftime should also support the + conversion specification flag. I filed a bug report for that here: https://sourceware.org/bugzilla/show_bug.cgi?id=24264 --------------B07B78200F2B8E0DC3CFAE99 Content-Type: text/x-patch; name="0001-build-update-gnulib-submodule-to-latest.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-build-update-gnulib-submodule-to-latest.patch" >From c50c4ab9e16df9368d52ed8cada3f3f2e32f093a Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 24 Feb 2019 23:35:23 -0800 Subject: [PATCH 1/3] build: update gnulib submodule to latest --- gnulib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnulib b/gnulib index e3970fb98..188d87b05 160000 --- a/gnulib +++ b/gnulib @@ -1 +1 @@ -Subproject commit e3970fb9891668bd9dbc94daca18dc0d42b7e466 +Subproject commit 188d87b05190690d6f8b0577ec65ef221a711d08 -- 2.17.1 --------------B07B78200F2B8E0DC3CFAE99 Content-Type: text/x-patch; name="0002-date-conversion-specification-flag.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0002-date-conversion-specification-flag.patch" >From b1e7af28ebc4b7218b2a76eee1dca738d3224a63 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 24 Feb 2019 23:59:22 -0800 Subject: [PATCH 2/3] =?UTF-8?q?date:=20=E2=80=98+=E2=80=99=20conversion=20?= =?UTF-8?q?specification=20flag?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The recent Gnulib update fixed Bug#34608; document and test this. * NEWS: Mention the change. * doc/coreutils.texi (Padding and other flags): Update doc to cover new flag and other POSIX.1-2017 changes. * tests/misc/date.pl (date-century-plus): New test. --- NEWS | 3 +++ doc/coreutils.texi | 15 ++++++++++++--- tests/misc/date.pl | 3 +++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 5d9956854..e73cb52b8 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,9 @@ GNU coreutils NEWS -*- outline -*- after asking the user whether to proceed. [This bug was present in "the beginning".] + 'date' now supports the '+' conversion specification flag, + introduced in POSIX.1-2017. + df no longer corrupts displayed multibyte characters on macOS. [bug introduced with coreutils-8.18] diff --git a/doc/coreutils.texi b/doc/coreutils.texi index 028371673..d1427323c 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -15985,24 +15985,33 @@ example, numeric months are always output as two digits. Seconds since the epoch are not padded, though, since there is no natural width for them. -As a GNU extension, @command{date} recognizes any of the -following optional flags after the @samp{%}: +The following optional flags can appear after the @samp{%}: @table @samp @item - (hyphen) Do not pad the field; useful if the output is intended for human consumption. +This is a GNU extension. @item _ (underscore) Pad with spaces; useful if you need a fixed number of characters in the output, but zeros are too distracting. +This is a GNU extension. @item 0 (zero) Pad with zeros even if the conversion specifier would normally pad with spaces. +@item + +Pad with zeros, like @samp{0}. In addition, precede any year number +with @samp{+} if it exceeds 9999 or if its field width exceeds 4; +similarly, precede any century number with @samp{+} if it exceeds 99 +or if its field width exceeds 2. Preceding with @samp{+} is helpful +for generationg some ISO 8601 formats. @item ^ Use upper case characters if possible. +This is a GNU extension. @item # Use opposite case characters if possible. A field that is normally upper case becomes lower case, and vice versa. +This is a GNU extension. @end table @noindent @@ -16017,7 +16026,7 @@ date +%_d/%_m -d "Feb 1" @result{} 1/ 2 @end example -As a GNU extension, you can specify the field width +You can optionally specify the field width (after any flag, if present) as a decimal number. If the natural size of the output of the field has less than the specified number of characters, the result is written right adjusted and padded to the given diff --git a/tests/misc/date.pl b/tests/misc/date.pl index 5e12158e9..9ba3d3983 100755 --- a/tests/misc/date.pl +++ b/tests/misc/date.pl @@ -297,6 +297,9 @@ my @Tests = {ENV => 'TZ=PST8'}, {OUT => 'Wed Dec 31 21:00:00 PST 1969'}, ], + + # https://bugs.gnu.org/34608 + ['date-century-plus', '-d @0 +.%+4C.', {OUT => '.+019.'}], ); # Repeat the cross-dst test, using Jan 1, 2005 and every interval from 1..364. -- 2.17.1 --------------B07B78200F2B8E0DC3CFAE99 Content-Type: text/x-patch; name="0003-doc-fix-typo-in-previous-patch.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0003-doc-fix-typo-in-previous-patch.patch" >From 3e7fd6650e6040c6b09f97d6f189e0365727df90 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 25 Feb 2019 00:19:22 -0800 Subject: [PATCH 3/3] doc: fix typo in previous patch --- doc/coreutils.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/coreutils.texi b/doc/coreutils.texi index d1427323c..886ecf451 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -16004,7 +16004,7 @@ Pad with zeros, like @samp{0}. In addition, precede any year number with @samp{+} if it exceeds 9999 or if its field width exceeds 4; similarly, precede any century number with @samp{+} if it exceeds 99 or if its field width exceeds 2. Preceding with @samp{+} is helpful -for generationg some ISO 8601 formats. +for generating some ISO 8601 formats. @item ^ Use upper case characters if possible. This is a GNU extension. -- 2.17.1 --------------B07B78200F2B8E0DC3CFAE99-- ------------=_1551083342-4644-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 21 Feb 2019 17:10:23 +0000 Received: from localhost ([127.0.0.1]:59790 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gwrra-0006Ci-Pn for submit@debbugs.gnu.org; Thu, 21 Feb 2019 12:10:23 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44031) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gwrrZ-0006CV-5e for submit@debbugs.gnu.org; Thu, 21 Feb 2019 12:10:21 -0500 Received: from lists.gnu.org ([209.51.188.17]:59553) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gwrrT-0004lD-Rw for submit@debbugs.gnu.org; Thu, 21 Feb 2019 12:10:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58390) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gwrrN-000868-Lm for bug-coreutils@gnu.org; Thu, 21 Feb 2019 12:10:15 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gwrrM-0004gz-Rc for bug-coreutils@gnu.org; Thu, 21 Feb 2019 12:10:09 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41532) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gwrrM-0004gY-Kc for bug-coreutils@gnu.org; Thu, 21 Feb 2019 12:10:08 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BB2B9307D8F4 for ; Thu, 21 Feb 2019 17:10:07 +0000 (UTC) Received: from [10.3.116.222] (ovpn-116-222.phx2.redhat.com [10.3.116.222]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 90238282D0 for ; Thu, 21 Feb 2019 17:10:07 +0000 (UTC) To: bug-coreutils@gnu.org From: Eric Blake Subject: date +%+4C is unimplemented, contrary to POSIX Organization: Red Hat, Inc. Message-ID: <2d7755c4-d5eb-db3a-f7cc-37ff97ddfcb9@redhat.com> Date: Thu, 21 Feb 2019 11:10:06 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Thu, 21 Feb 2019 17:10:07 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) POSIX requires the '+' flag in %C to output padding with leading 0, and additionally to add a +/- indicator if the minimum field width is larger than 2 bytes. Thus: date -d 0001-01-01 +.%+4C. should produce ".+000.", but currently it produces ".%+4C." because the + flag is unimplemented. See also http://austingroupbugs.net/view.php?id=1184 -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org ------------=_1551083342-4644-1--