Many people are used to seeing ISO 8601 dates using a period separating
seconds and nanoseconds. This behavior seems to be worth documenting
given the bug reports:
https://bugs.gnu.org/63119
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1118970
* doc/coreutils.texi (Options for date): Mention that
'date --iso-8601=ns' uses a comma as a separator, following the
preference of ISO 8601. Give an example of how to get an ISO 8601 date
with a period separator.
---
doc/coreutils.texi | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 13f9f9a46..a4c9feffc 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -17181,6 +17181,15 @@ @node Options for date
@item ns
Also print nanoseconds.
This is like the format @code{%Y-%m-%dT%H:%M:%S,%N%:z}.
+
+ISO 8601 allows a comma or period to be used to separate seconds from
+subseconds, preferring the use of a comma. GNU @command{date} follows
+this preference. If you would prefer to use a period separator, you can
+transform the output of @samp{date --rfc-3339=ns}:
+
+@example
+date --rfc-3339=ns | sed s'/ /T/'
+@end example
@end table
@macro dateParseNote
--
2.51.1