5

In several projects I have worked on we have used

YYYY-MM-DDThh:mm:ssUTC

e.g.

2017-01-01T12:00:00UTC

as the time-format and claimed it (incorrectly?) to be a compliant subset of ISO-8601.

It is clear that ISO-8601 includes Z and +hhmm as legal ways of specifying the offset from UTC and thereby the time-zone (ignoring daylight savings).

It seems clear that the W3C and most other organisations adopting (subsets of) ISO-8601 prefer to use Z (and +hhmm).

I'm looking for someone familiar with or better yet owning a copy of ISO-8601 to confirm whether or not it is conformant to use any time-zone abbreviation at all and UTC in particular (as a synonym for zulu-time 'Z').

I believe IANA is responsible for time-zones and ISO-8601 uses offsets only to avoid having to deal with the issue of time-zones changing.

I found an older version of the standard here which does not mention time-zone abbreviations. I would like confirmation that it is is not valid in the current standard (ISO-8601:2004?) to use UTC and claim ISO-8601 conformance.

Bruce Adams
  • 4,953
  • 4
  • 48
  • 111

1 Answers1

6

I have ISO-8601:2004, which according to Wikipedia is the latest edition. I do not see that it allows the use of UTC in place of Z, though it mentions "UTC" quite often in the specification.

Howard Hinnant
  • 206,506
  • 52
  • 449
  • 577
  • 4
    I will confirm this. The string literal `UTC` is not valid for ISO-8601, nor are any other abbreviations than `Z`. Also, there's [a new draft pending for ISO8601](https://www.iso.org/news/2017/02/Ref2164.html), but I seriously doubt they will introduce time zone abbreviations. – Matt Johnson-Pint May 17 '17 at 18:13
  • Thanks for the interesting link. The article alludes to new ways to represent terms like "semester, trimester, spring, summer, autumn, winter". It doesn't go into much depth but it looks like the standard will become more complex yet. – Bruce Adams May 18 '17 at 16:54
  • Interestingly I have just found https://www.timetemperature.com/abbreviations/world_time_zone_abbreviations.shtml which uses UTC and in HTTP https://tools.ietf.org/html/rfc7234#section-5.5.0 " o A cache recipient SHOULD consider a date with a zone abbreviation other than GMT or UTC to be invalid for calculating expiration." This is surprising as HTTP claims to use ISO-8601 compliant date-times. – Bruce Adams Nov 27 '18 at 10:40
  • I also note that the unix date command +%Z gives the "alphabetic time zone abbreviation" but gives UTC. See man7.org/linux/man-pages/man1/date.1.html . I suspect it was this oddity that led us down the path of using UTC instead of Z when originally working with shell scripts. – Bruce Adams Sep 07 '20 at 16:57