0009 - Use Timezone Aware DateTimes and UTC¶
Date¶
2022-12-20
Status¶
Accepted
Context¶
Different systems interpret naive date times in different ways causing inconsistent localised dates and times when used incorrectly.
Furthermore, the BetterFleet suite of products are intended to be used by and across multiple timezones making correct date time display and calculations critical to the success of the product.
Decision¶
We will use timezone aware date times whereever possible for calculations, storage and presentation.
Internally, all date times will be stored as UTC date times. On entry to the system, naive date times will be converted to timezone aware datetimes and set to UTC. At the presentation layer (UI etc), dates and times will be converted to meet the presentation need as a local or account specific timezone.
Consequences¶
Interpretation of timezones will be simplified by following a standard approach across all our Products and help with reuse of common presentation layer components.