FHIR Chat · Timezones in DateTime · conformance

Stream: conformance

Topic: Timezones in DateTime


view this post on Zulip ryan moehrke (May 07 2021 at 14:13):

For Timezones in DateTime you can express them like 2021-05-07T09:02:25Z or 2021-05-07T09:02:25-06:00 etc.
but for 2021-05-07T09:02:25Z can you also represent it as 2021-05-07T09:02:25+00:00 and/or 2021-05-07T09:02:25-00:00 are either of these conformant? it looked like they were from the regex https://www.hl7.org/fhir/datatypes.html#dateTime
but would they be expected to be understood?

view this post on Zulip Josh Mandel (May 07 2021 at 14:49):

Absolutely -- those are valid ISO 8601 offsets. Wikipedia has a nice summary:

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".

view this post on Zulip ryan moehrke (May 07 2021 at 17:03):

is ISO 8601 what FHIR is following here? I see no mention of that on the datatypes page at all
also if yes then -00:00 would not be valid?

view this post on Zulip Josh Mandel (May 07 2021 at 17:08):

Formally FHIR leans on xs: defintions -- https://www.w3.org/TR/xmlschema-2/#isoformats and in particular:

The mapping so defined is one-to-one, except that '+00:00', '-00:00', and 'Z' all represent the same zero-length duration timezone, UTC; 'Z' is its canonical representation.

view this post on Zulip Josh Mandel (May 07 2021 at 17:10):

(Today I learned... xs: definitions "use lexical formats inspired by [ISO 8601]" -- emphasis mine.)

view this post on Zulip ryan moehrke (May 07 2021 at 17:13):

I personally like this excerpt from that last link

'+' indicates a nonnegative duration,
'-' indicates a nonpositive duration.

Last updated: Apr 12 2022 at 19:14 UTC