From unknown Mon Aug 18 11:22:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40586: date and '%-N' does not appear to remove leading zeros anymore, but trailing zeros. Resent-From: Drake Jacovian Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Sun, 12 Apr 2020 22:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 40586 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 40586@debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.158672925017752 (code B ref -1); Sun, 12 Apr 2020 22:08:02 +0000 Received: (at submit) by debbugs.gnu.org; 12 Apr 2020 22:07:30 +0000 Received: from localhost ([127.0.0.1]:58981 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNklF-0004cG-Jk for submit@debbugs.gnu.org; Sun, 12 Apr 2020 18:07:29 -0400 Received: from lists.gnu.org ([209.51.188.17]:38357) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNjZq-0002sZ-89 for submit@debbugs.gnu.org; Sun, 12 Apr 2020 16:51:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39129) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jNjZp-0006tF-8M for bug-coreutils@gnu.org; Sun, 12 Apr 2020 16:51:38 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_NONE autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jNjZn-0005W6-IM for bug-coreutils@gnu.org; Sun, 12 Apr 2020 16:51:37 -0400 Received: from mail.onyx.syn-alias.com ([206.152.134.66]:62146 helo=smtp.centurylink.net) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jNjZn-0005VL-E0 for bug-coreutils@gnu.org; Sun, 12 Apr 2020 16:51:35 -0400 X_CMAE_Category: , , X-CNFS-Analysis: v=2.3 cv=V5cDLtvi c=1 sm=1 tr=0 a=d/ybXNJ+flyutKwNqkzelQ==:117 a=d/ybXNJ+flyutKwNqkzelQ==:17 a=KGjhK52YXX0A:10 a=IkcTkHD0fZMA:10 a=cl8xLZFz6L8A:10 a=_UklSX3_TQYA:10 a=eQrCS-SpgXYA:10 a=kXSUiVnb9JNYGMEXnEkA:9 a=QEXdDO2ut3YA:10 X-CM-Score: 0 X-Scanned-by: Cloudmark Authority Engine Feedback-ID: dfw:ctl:res:onyx X-Authed-Username: bHNpdHptYW5AY2VudHVyeWxpbmsubmV0 Authentication-Results: smtp02.onyx.dfw.sync.lan smtp.user=lsitzman@centurylink.net; auth=pass (LOGIN) Received: from [75.168.16.82] ([75.168.16.82:38649] helo=infernalbeast.com) by smtp.centurylink.net (envelope-from ) (ecelerity 3.6.25.56547 r(Core:3.6.25.0)) with ESMTPA id 04/64-04319-55F739E5; Sun, 12 Apr 2020 16:51:33 -0400 Received: from [192.168.1.100] (DD-WRT [192.168.1.1]) by infernalbeast.com (Postfix) with ESMTPSA id AB0F0D00021 for ; Sun, 12 Apr 2020 15:51:32 -0500 (CDT) From: Drake Jacovian Message-ID: <50c74837-966c-1310-4b7b-63f5080f8873@infernalbeast.com> Date: Sun, 12 Apr 2020 15:51:32 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 206.152.134.66 X-Spam-Score: -0.7 (/) X-Mailman-Approved-At: Sun, 12 Apr 2020 18:07:28 -0400 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: -1.7 (-) Using... date (GNU coreutils) 8.32 uname -a Linux server 4.19.114-1-MANJARO #1 SMP Thu Apr 2 17:04:36 UTC 2020 x86_64 GNU/Linux I have noticed that %-N when used with the data command no longer appears to always remove leading zeros, instead it appears to be removing trailing zeros? Obviously, removing trailing zeroes will changes it value. From the date manual '(hyphen) do not pad the field' As an example of this... for i in {1..100}; do date +'%-N'; sleep 0.01; done ...can return the following values. 975014256 98960514 004239247 018627712 032860182 047079472 061412362 075671305 090001272 104960757 119612273 134225597 148815084 163728277 17841512 19301887 207621036 From unknown Mon Aug 18 11:22:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40586: date and '%-N' does not appear to remove leading zeros anymore, but trailing zeros. Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Sun, 12 Apr 2020 23:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40586 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Drake Jacovian Cc: 40586@debbugs.gnu.org Received: via spool by 40586-submit@debbugs.gnu.org id=B40586.158673332023808 (code B ref 40586); Sun, 12 Apr 2020 23:16:02 +0000 Received: (at 40586) by debbugs.gnu.org; 12 Apr 2020 23:15:20 +0000 Received: from localhost ([127.0.0.1]:59002 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNlot-0006Bw-SY for submit@debbugs.gnu.org; Sun, 12 Apr 2020 19:15:20 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:35530) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNloq-0006Bh-Nh for 40586@debbugs.gnu.org; Sun, 12 Apr 2020 19:15:18 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 85C22160017; Sun, 12 Apr 2020 16:15:10 -0700 (PDT) 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 6R0LRnBONxz2; Sun, 12 Apr 2020 16:15:09 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id E3E7A160094; Sun, 12 Apr 2020 16:15:09 -0700 (PDT) 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 JCIdAvuYL35o; Sun, 12 Apr 2020 16:15:09 -0700 (PDT) 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 BA7DA160017; Sun, 12 Apr 2020 16:15:09 -0700 (PDT) References: <50c74837-966c-1310-4b7b-63f5080f8873@infernalbeast.com> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: Date: Sun, 12 Apr 2020 16:15:09 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <50c74837-966c-1310-4b7b-63f5080f8873@infernalbeast.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 (---) On 4/12/20 1:51 PM, Drake Jacovian wrote: > Obviously, removing trailing zeroes will changes it value. %-N is intended to be used after a decimal point, so removing trailing zeros does not change its value in its intended use. From unknown Mon Aug 18 11:22:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40586: date and '%-N' does not appear to remove leading zeros anymore, but trailing zeros. References: <50c74837-966c-1310-4b7b-63f5080f8873@infernalbeast.com> In-Reply-To: <50c74837-966c-1310-4b7b-63f5080f8873@infernalbeast.com> Resent-From: joerg.boehmer@snafu.de Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Thu, 14 Apr 2022 16:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40586 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 40586@debbugs.gnu.org Received: via spool by 40586-submit@debbugs.gnu.org id=B40586.164995504919347 (code B ref 40586); Thu, 14 Apr 2022 16:51:01 +0000 Received: (at 40586) by debbugs.gnu.org; 14 Apr 2022 16:50:49 +0000 Received: from localhost ([127.0.0.1]:57252 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nf2gC-00051x-Pt for submit@debbugs.gnu.org; Thu, 14 Apr 2022 12:50:49 -0400 Received: from longisland.snafu.de ([84.23.254.153]:16010) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nf2dn-0004wz-Gp for 40586@debbugs.gnu.org; Thu, 14 Apr 2022 12:48:20 -0400 X-Trace: 4c7c6a6f6572672e626f65686d657240736e6166752e64657c38342e32332e3235 342e3230377c316e663264662d3030304372652d52337c31363439393534383931 Received: from longisland.snafu.de ([10.153.10.19] helo=localhost) by longisland.snafu.de with esmtpa (Exim 4.94.2) id 1nf2df-000Cre-R3 for 40586@debbugs.gnu.org; Thu, 14 Apr 2022 18:48:12 +0200 MIME-Version: 1.0 Date: Thu, 14 Apr 2022 18:48:11 +0200 From: joerg.boehmer@snafu.de User-Agent: Roundcube Webmail/1.4.13 Message-ID: X-Sender: joerg.boehmer@snafu.de Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-VISP-ShouldScan: 1 X-VISP-Virus-Check: clean X-VISP-Spam-Score: -0.2 (/) X-VISP-Spam-Report: This message has been scanned on "longisland.snafu.de" to identify if it is considered spam or not. Contact the support hotline for details. Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.5 JMQ_SPF_NEUTRAL ASKDNS: SPF set to ?all [snafu.de TXT:v=spf1 mx ip4:84.23.254.128/25] [ip6:2001:1560:3:255::/64 ip6:2001:1560:3:254::/64 ip4:213.73.113.34/32 ip6:2001:1560:a000:2:50:ff:fe00:27ed/128 include:spf.emailsys.net ?all] -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP 0.0 KAM_DMARC_STATUS Test Rule for DKIM or SPF Failure with Strict Alignment -0.0 T_SCC_BODY_TEXT_LINE No description available. 0.2 KAM_DMARC_NONE DKIM has Failed or SPF has failed on the message and the domain has no DMARC policy X-VISP-Spam-Max-Score: +++++ X-SA-Exim-Connect-IP: 84.23.254.207 X-SA-Exim-Mail-From: joerg.boehmer@snafu.de X-SA-Exim-Scanned: No (on longisland.snafu.de); SAEximRunCond expanded to false X-Spam-Score: -0.7 (/) X-Mailman-Approved-At: Thu, 14 Apr 2022 12:50:48 -0400 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: -1.7 (-) > %-N is intended to be used after a decimal point... Please note this intention in the man-page. The current man-page: %N nanoseconds (000000000..999999999) The current description gives the impression that nanoseconds are an integral quantity like seconds and minutes. This leads the user to assume that leading zeros are being removed. From unknown Mon Aug 18 11:22:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40586: date and '%-N' does not appear to remove leading zeros anymore, but trailing zeros. Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Thu, 14 Apr 2022 22:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40586 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: joerg.boehmer@snafu.de, 40586@debbugs.gnu.org Received: via spool by 40586-submit@debbugs.gnu.org id=B40586.164997424620451 (code B ref 40586); Thu, 14 Apr 2022 22:11:02 +0000 Received: (at 40586) by debbugs.gnu.org; 14 Apr 2022 22:10:46 +0000 Received: from localhost ([127.0.0.1]:57556 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nf7fq-0005Jn-C9 for submit@debbugs.gnu.org; Thu, 14 Apr 2022 18:10:46 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:41176) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nf7fo-0005JZ-Ny for 40586@debbugs.gnu.org; Thu, 14 Apr 2022 18:10:45 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 56CC616007E; Thu, 14 Apr 2022 15:10:38 -0700 (PDT) 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 tqc7K-KjZ9Zq; Thu, 14 Apr 2022 15:10:37 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 2AF94160098; Thu, 14 Apr 2022 15:10:37 -0700 (PDT) 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 jAcAzQZvt8BL; Thu, 14 Apr 2022 15:10:37 -0700 (PDT) Received: from [131.179.64.200] (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 0BE2616007E; Thu, 14 Apr 2022 15:10:37 -0700 (PDT) Message-ID: Date: Thu, 14 Apr 2022 15:10:36 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Content-Language: en-US References: <50c74837-966c-1310-4b7b-63f5080f8873@infernalbeast.com> From: Paul Eggert Organization: UCLA Computer Science Department In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable 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 (---) On 4/14/22 09:48, joerg.boehmer@snafu.de wrote: > %N=C2=A0=C2=A0=C2=A0=C2=A0 nanoseconds (000000000..999999999) >=20 > The current description gives the impression that nanoseconds are an=20 > integral quantity like seconds and minutes. This leads the user to=20 > assume that leading zeros are being removed. Similar wording is used elsewhere: %M minute (00..59) %m month (01..12) %H hour (00..23) %W week number of year, with Monday as first day of week (00..53) It's true that nanoseconds are more complicated than the others.=20 However, it's not clear whether all the little details need to be in the=20 man page, or how to summarize those details concisely. From unknown Mon Aug 18 11:22:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40586: date and '%-N' does not appear to remove leading zeros anymore, but trailing zeros. Resent-From: joerg.boehmer@snafu.de Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 15 Apr 2022 14:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40586 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Paul Eggert Cc: 40586@debbugs.gnu.org Received: via spool by 40586-submit@debbugs.gnu.org id=B40586.165003287130254 (code B ref 40586); Fri, 15 Apr 2022 14:28:02 +0000 Received: (at 40586) by debbugs.gnu.org; 15 Apr 2022 14:27:51 +0000 Received: from localhost ([127.0.0.1]:60034 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nfMvO-0007ru-W4 for submit@debbugs.gnu.org; Fri, 15 Apr 2022 10:27:51 -0400 Received: from cosmopolitan.snafu.de ([84.23.254.151]:33681) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nfMvM-0007rd-Kg for 40586@debbugs.gnu.org; Fri, 15 Apr 2022 10:27:49 -0400 X-Trace: 4c7c6a6f6572672e626f65686d657240736e6166752e64657c38342e32332e3235 342e3230367c316e664d76442d3030304470382d43557c31363530303332383539 Received: from cosmopolitan.snafu.de ([10.151.10.19] helo=localhost) by cosmopolitan.snafu.de with esmtpa (Exim 4.94.2) id 1nfMvD-000Dp8-CU; Fri, 15 Apr 2022 16:27:40 +0200 MIME-Version: 1.0 Date: Fri, 15 Apr 2022 16:27:39 +0200 From: joerg.boehmer@snafu.de In-Reply-To: References: <50c74837-966c-1310-4b7b-63f5080f8873@infernalbeast.com> User-Agent: Roundcube Webmail/1.4.13 Message-ID: X-Sender: joerg.boehmer@snafu.de Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-VISP-ShouldScan: 1 X-VISP-Virus-Check: clean X-VISP-Spam-Score: 2.8 (++) X-VISP-Spam-Report: This message has been scanned on "cosmopolitan.snafu.de" to identify if it is considered spam or not. Contact the support hotline for details. Content analysis details: (2.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.5 JMQ_SPF_NEUTRAL ASKDNS: SPF set to ?all [snafu.de TXT:v=spf1 mx ip4:84.23.254.128/25] [ip6:2001:1560:3:255::/64 ip6:2001:1560:3:254::/64 ip4:213.73.113.34/32 ip6:2001:1560:a000:2:50:ff:fe00:27ed/128 include:spf.emailsys.net ?all] -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP 3.0 INX_BDY_BL_156 BODY: Spam 0.2 KAM_DMARC_NONE DKIM has Failed or SPF has failed on the message and the domain has no DMARC policy -0.0 T_SCC_BODY_TEXT_LINE No description available. 0.0 KAM_DMARC_STATUS Test Rule for DKIM or SPF Failure with Strict Alignment X-VISP-Spam-Max-Score: +++++ X-SA-Exim-Connect-IP: 84.23.254.206 X-SA-Exim-Mail-From: joerg.boehmer@snafu.de X-SA-Exim-Scanned: No (on cosmopolitan.snafu.de); SAEximRunCond expanded to false X-Spam-Score: -0.7 (/) 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: -1.7 (-) Am 15.04.2022 00:10, schrieb Paul Eggert: > On 4/1hour...4/22 09:48, joerg.boehmer@snafu.de wrote: > >> %N     nanoseconds (000000000..999999999) >> >> The current description gives the impression that nanoseconds are an >> integral quantity like seconds and minutes. This leads the user to >> assume that leading zeros are being removed. > > Similar wording is used elsewhere: > > %M minute (00..59) > %m month (01..12) > %H hour (00..23) > %W week number of year, with Monday as first day of week (00..53) > > It's true that nanoseconds are more complicated than the others. > However, it's not clear whether all the little details need to be in > the man page, or how to summarize those details concisely. The problem is imo the naming: second, minute, hour ... are all integral values counting from 0 to some max. value. Thus everybody expects that zeros are padded to the left side. But %N is now considered the fractional part of the second in nanoseconds granularity or the positions after decimal point. Thus everybody can assume that the padding is applied to the right. I think it's very important that the user quickly grasps the meaning of the formats from the man page to avoid frustration.