mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-19 03:33:43 +03:00
date: document +%-N change
Suggested by Kamil Dudka in: https://lists.gnu.org/r/bug-gnulib/2020-05/msg00205.html * NEWS: Mention the change for coreutils 8.23. * doc/coreutils.texi (Padding and other flags): Document it.
This commit is contained in:
1 parent
4181fc5183
commit
6d0107a37f
2 files changed
+12
-3
No files matched your search
@@ -90,6 +90,11 @@ GNU coreutils NEWS -*- outline -*-
|
||||
[The old behavior was introduced in sh-utils 2.0.15 ca. 1999, predating
|
||||
coreutils package.]
|
||||
|
||||
date now pads nanoseconds on the right, not the left. For example,
|
||||
if the time is currently 1590020079.003388470 seconds after the
|
||||
Epoch, then "date '+%s.%-N'" formerly output "1590020079.3388470",
|
||||
and it now outputs "1590020079.00338847".
|
||||
|
||||
ls issues an error message on a removed directory, on GNU/Linux systems.
|
||||
Previously no error and no entries were output, and so indistinguishable
|
||||
from an empty directory, with default ls options.
|
||||
|
||||
+7
-3
@@ -16034,7 +16034,10 @@ a horizontal tab
|
||||
Unless otherwise specified, @command{date} normally pads numeric fields
|
||||
with zeros, so that, for
|
||||
example, numeric months are always output as two digits.
|
||||
Seconds since the epoch are not padded, though,
|
||||
Most numeric fields are padded on the left.
|
||||
However, nanoseconds are padded on the right since they are commonly
|
||||
used after decimal points in formats like @samp{%s.%-N}.
|
||||
Also, seconds since the epoch are not padded
|
||||
since there is no natural width for them.
|
||||
|
||||
The following optional flags can appear after the @samp{%}:
|
||||
@@ -16082,9 +16085,10 @@ date +%_d/%_m -d "Feb 1"
|
||||
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
|
||||
the result is normally written right adjusted and padded to the given
|
||||
size. For example, @samp{%9B} prints the right adjusted month name in
|
||||
a field of width 9.
|
||||
a field of width 9. Nanoseconds are left adjusted, and are truncated
|
||||
or padded to the field width.
|
||||
|
||||
An optional modifier can follow the optional flag and width
|
||||
specification. The modifiers are:
|
||||
|
||||
Reference in new issue
Block a user