How does the app handle time zones? #3414
scooter-dangle
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This ends up being low-lying obstacle we often trip over, esp where our assumptions about how the app handles time representation/storage don't match reality.
Examples
Questions to answer about app's current behavior
What datetime model fields are essentially just dates? E.g., either they are stored explicitly as dates without associated time in Postgres or, if they are stored with time information, the app only ever uses the 0 time (e.g., midnight) due to only the date being relevant from the app's perspective?
What model fields do have relevant, non-zero times associated?
For number 2, is a time zone stored with those times, and how is that time zone determined (e.g., is it just server time zone? (and what time zone would that be?) or is there some attempt to determine the user's time zone?)
Are there any cases for number 3 where the entry time zone differs from the presentation / queried time zone?
Notes about impact
The vast majority of banks operate in locales where all other orgs they directly interact with (such that they would need to agree on a time-of-day) are in the same zone, so org A saying 1:30pm to org B is sufficient regardless of the time zone the server stores it as. However, when the server interacts with other systems that correctly handle time zones, it may need to translate that 1:30pm time (likely stored as UTC) into the user's time zone. E.g., for the Google Calendars distribution integration, we need users to specify the time zone of the distribution location.
Additionally, the impact of incorrect time zone handling is reduced by our users operating primarily (entirely?) within the 4 zones of the US Lower 48 states. Since most account activity occurs during typical 9–5 business hours, even banks on the West Coast are not likely to see much activity occurring during one Pacific Time show up as occurring the next day if the server is using UTC time (during standard time, the PT business day ends 1 hour into the next date UTC, but during Daylight Saving Time, the PT business day ends at midnight UTC).
Beta Was this translation helpful? Give feedback.
All reactions