On ISO 8601 date, is T required?

I am wondering if the following date is ISO8601:

2012-03-02 14:57:05.456+0500

      

(for sure, 2012-03-02T14: 57: 05.456 + 0500 is compatible, but not that much readable!) IOW, is the T value between date and time required?

+27


source to share


2 answers


This is required unless the clearinghouse partners agree to skip it.

Quoting from ISO 8601 section 4.3.2:



The [T] character should be used as a timestamp to indicate the start of the representation of the time of day component in these expressions. [...]

NOTE. By mutual agreement of the communication partners, the [T] symbol may be omitted in applications where there is no risk of confusing the date and time of day representation with others defined in this International Standard.

Omit this quite often, but it is advisable to leave it if the view is for machine readable and you do not have a clear agreement that it can be omitted.

+21


source


This date does not comply with ISO-8601 as pointed out by Keith Thompson, but does comply with RFC 3339, profile ISO 8601. Sort of. See the NOTE at the bottom of the following text from RFC 3339 :



date-time       = full-date "T" full-time

  NOTE: Per [ABNF] and ISO8601, the "T" and "Z" characters in this
  syntax may alternatively be lower case "t" or "z" respectively.

  This date/time format may be used in some environments or contexts
  that distinguish between the upper- and lower-case letters 'A'-'Z'
  and 'a'-'z' (e.g. XML).  Specifications that use this format in
  such environments MAY further limit the date/time syntax so that
  the letters 'T' and 'Z' used in the date/time syntax must always
  be upper case.  Applications that generate this format SHOULD use
  upper case letters.

  NOTE: ISO 8601 defines date and time separated by "T".
  Applications using this syntax may choose, for the sake of
  readability, to specify a full-date and full-time separated by
  (say) a space character.

      

+10


source







All Articles