6 ms·
This gets repeated a lot but unfortunately isn't true. See the spec: https://tools.ietf.org/html/rfc3339 https://tools.ietf.org/html/rfc3339 NOTE: ISO 860
by seagreen 6y ago
This gets repeated a lot but unfortunately isn't true.
See the spec: https://tools.ietf.org/html/rfc3339 https://tools.ietf.org/html/rfc3339
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.
Someday someone reading this is going to set out to make a new, small specification out of a huge specification. Reader, when you start to feel the temptation to make just the tiniest improvement-- resist! It's way more useful if it's actually a true subset.
Happily this particular issue is be easily fixed. Let's make a new spec, subsetting both ISO 8601 and RFC 3339.
I hereby introduce... RFC 3339T, which is exactly like RFC 3339, but you have to use a T instead of a space.
EDIT: joshuaissac spotted another difference.
Also I made a repo so we're official: https://github.com/seagreen/rfc-3339T https://github.com/seagreen/rfc-3339T
- joshuaissac 6y agoRFC 3339 also allows the offset -00:00 where the UTC time is known but the local time is not. The ISO standard does not permit this.
- seagreen 6y agoOoh, interesting. I made a GitHub repo for the new spec and credited you (https://github.com/seagreen/rfc-3339T https://github.com/seagreen/rfc-3339T). Let me know if you have more suggestions!
- fanf2 6y ago-00:00 is permitted by ISO 8601 but it implies that the local time is the same as UTC, it does not imply that the local time is unknown.
- seagreen 6y agoIs Wikipedia wrong? It claims (https://en.wikipedia.org/wiki/ISO_8601 https://en.wikipedia.org/wiki/ISO_8601): An offset of zero, in addition to having the special representation "Z", can also be stated numerically as "+00:00", "+0000", or "+00". However, it is not permitted to state it numerically with a negative sign, as "−00:00", "−0000", or "−00"." Sure would be nice if we could read the spec online:)
- mro_name 6y agothe author of GNU "date" says: "… This paragraph was put into the RFC at my suggestion, precisely so that GNU "date" output wouldn't have to contain that "T". …" https://debbugs.gnu.org/cgi/bugreport.cgi?bug=39693#15 https://debbugs.gnu.org/cgi/bugreport.cgi?bug=39693#15
- seagreen 6y agoMystery solved!
- d0mine 6y agoFrom the abstract of the spec: This document defines a date and time format for use in Internet protocols that is a profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar [emphasize is mine] https://tools.ietf.org/html/rfc3339 https://tools.ietf.org/html/rfc3339