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: Paul Eggert <eggert <at> cs.ucla.edu>
To: joerg.boehmer <at> snafu.de, 40586 <at> debbugs.gnu.org
Subject: bug#40586: date and '%-N' does not appear to remove leading zeros anymore, but trailing zeros.
Date: Thu, 14 Apr 2022 15:10:36 -0700
On 4/14/22 09:48, joerg.boehmer <at> 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.




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

Previous Next


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