Eric Blake wrote:
> According to Romain Lenglet on 5/3/2006 12:47 AM:
> > Hi,
> >
> > RFC 3339 makes it *mandatory* to separate the date and time
> > with a "T" in timestamps. Cf. section 5.6 of RFC 3339,
> > describing the timestamp syntax in ABNF:
> >
> > date-time       = full-date "T" full-time
>
> Hmm.  Are you sure about that?  My understanding was that we
> deprecated -I for being non-compliant with ISO 8601 because
> RFC 3339 explicitly requires that the 'T' NOT appear in the
> date.  Reread section 5.6 in RFC 3339, which permits
> implementations to avoid 'T'.

I know, the "NOTE" is ambiguous in section 5.6. But the ABNF 
specifications are not. And the comments in Appendix A are not, 
either.

> See the threads here, where the 
> --rfc-3339 option was discussed, and later added:
>
> http://lists.gnu.org/archive/html/bug-coreutils/2005-07/msg001
>86.html
> http://lists.gnu.org/archive/html/bug-coreutils/2005-09/msg000
>56.html

I was aware of this thread. Thanks.

> If you need the "T", for now you can rely on the undocumented
> --iso-8601 option.
>
> > I am not providing you a patch, since I don't want to go
> > through the administrative burden of copyright transfer for
> > so little, but here are the correct date formats for the RFC
> > 3339 options:
>
> If the patch is less than 10 lines, it is considered trivial
> and can be applied without copyright assignment.

OK. Here is one patch of two lines. ;-)

-- 
Romain LENGLET
--- coreutils/ChangeLog	2006-05-03 19:11:05.000000000 +0900
+++ coreutils-rfc3339/ChangeLog	2006-05-04 13:12:07.084884824 +0900
@@ -1,3 +1,9 @@
+2006-05-04  Romain Lenglet  <[EMAIL PROTECTED]>
+
+	* src/date.c: In --rfc-3339=seconds and --rfc-3339=ns output
+	formats, replace the space with "T" to respect RFC 3339's ABNF
+	specification.
+
 2006-05-03  Jim Meyering  <[EMAIL PROTECTED]>
 
 	* Version 6.0-cvs.
--- coreutils/NEWS	2006-04-24 06:38:32.000000000 +0900
+++ coreutils-rfc3339/NEWS	2006-05-04 13:20:16.797437200 +0900
@@ -153,6 +153,10 @@
   tail -f once again works on a file with the append-only
   attribute (affects at least Linux ext2, ext3, xfs file systems)
 
+  date's options --rfc-3339=seconds and --rfc-3339=ns now output
+  timestamps with a "T" instead of a space between date and time, to
+  conform to RFC 3339's ABNF specification.
+
 * Major changes in release 5.93 (2005-11-06) [stable]
 
 ** Bug fixes
--- coreutils/THANKS	2006-05-03 19:11:25.000000000 +0900
+++ coreutils-rfc3339/THANKS	2006-05-04 13:12:50.990210200 +0900
@@ -422,6 +422,7 @@
 Rogier Wolff                        [EMAIL PROTECTED]
 Roland Huebner                      [EMAIL PROTECTED]
 Roland Turner                       [EMAIL PROTECTED]
+Romain Lenglet                      [EMAIL PROTECTED]
 Ronald F. Guilmette                 [EMAIL PROTECTED]
 Ross Alexander                      [EMAIL PROTECTED]
 Ross Paterson                       [EMAIL PROTECTED]
--- coreutils/src/date.c	2006-01-09 05:45:54.000000000 +0900
+++ coreutils-rfc3339/src/date.c	2006-05-04 13:16:49.156003496 +0900
@@ -345,8 +345,8 @@
 	    static char const rfc_3339_format[][32] =
 	      {
 		"%Y-%m-%d",
-		"%Y-%m-%d %H:%M:%S%:z",
-		"%Y-%m-%d %H:%M:%S.%N%:z"
+		"%Y-%m-%dT%H:%M:%S%:z",
+		"%Y-%m-%dT%H:%M:%S.%N%:z"
 	      };
 	    enum Time_spec i =
 	      XARGMATCH ("--rfc-3339", optarg,
_______________________________________________
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to