bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#40586: date and '%-N' does not appear to remove leading zeros anymor


From: joerg . boehmer
Subject: bug#40586: date and '%-N' does not appear to remove leading zeros anymore, but trailing zeros.
Date: Fri, 15 Apr 2022 16:27:39 +0200
User-agent: Roundcube Webmail/1.4.13

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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]