GNU bug report logs - #40586
date and '%-N' does not appear to remove leading zeros anymore, but trailing zeros.

Previous Next

Package: coreutils;

Reported by: Drake Jacovian <gnu.org <at> infernalbeast.com>

Date: Sun, 12 Apr 2020 22:08:02 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Drake Jacovian <gnu.org <at> infernalbeast.com>
To: 40586 <at> debbugs.gnu.org
Subject: bug#40586: date and '%-N' does not appear to remove leading zeros anymore, but trailing zeros.
Date: Sun, 12 Apr 2020 15:51:32 -0500
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






This bug report was last modified 3 years and 126 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.