Stream: fhirpath
Topic: Date/time arithmetic with daylight savings time
Paul Lynch (Jun 25 2019 at 14:29):
If you live in an area where time "falls back" an hour in November, what should be the result of:
@2019-06-25T10:26 + 6 months?
Brian Postlethwaite (Jun 25 2019 at 21:21):
Personally I would suggest same time of day.
Brian Postlethwaite (Jun 25 2019 at 21:22):
(or at least that's what I would expect)
Bryn Rhodes (Jun 25 2019 at 23:23):
The specification says "To support comparison of DateTime values, either both values have no timezone offset specified, or both values are converted to a common timezone offset. The timezone offset to use is an implementation decision. In the simplest case, it’s the timezone offset of the local server."
Bryn Rhodes (Jun 25 2019 at 23:26):
But that's for comparison. For arithmetic, it defers to 8601, which says "the same time of day at the same calendar day"
Bryn Rhodes (Jun 25 2019 at 23:28):
So yes, that's the expected behavior.
Bryn Rhodes (Jun 25 2019 at 23:28):
And I just confirmed that what the Java-based engine does.
Last updated: Apr 12 2022 at 19:14 UTC