05-03-2018, 04:45 PM
Hello,
Developing an app where users may be in different time zones. In past I never worried about this as system date time stamps matched local time of users. Now I am looking at using Postgres datetime type with time zone support and need best option for ensuring I have the correct local session time. Assuming all time is saved as UTC .
To make maters more interesting it could be case where driver leaves pt A at 5AM Pacific Time and gets to location at 6PM Pacific time ( 6 PM Mountain Time) as it crossed a time zone. The initial user makes all entries based on Pacific Time.
User at destination looks at system, the time would then display for him i mountain time (his local time zone).
Should I set time zone based on setting in user profile or should I get it from the browser setting and have it be dynamic to allow mobile devices to work if user is mobile and goes between timezones. I have some sample code that I will update this ticket with to show what app currently does , but find that it sometimes does not work as desired.
Cheers!
Developing an app where users may be in different time zones. In past I never worried about this as system date time stamps matched local time of users. Now I am looking at using Postgres datetime type with time zone support and need best option for ensuring I have the correct local session time. Assuming all time is saved as UTC .
To make maters more interesting it could be case where driver leaves pt A at 5AM Pacific Time and gets to location at 6PM Pacific time ( 6 PM Mountain Time) as it crossed a time zone. The initial user makes all entries based on Pacific Time.
User at destination looks at system, the time would then display for him i mountain time (his local time zone).
Should I set time zone based on setting in user profile or should I get it from the browser setting and have it be dynamic to allow mobile devices to work if user is mobile and goes between timezones. I have some sample code that I will update this ticket with to show what app currently does , but find that it sometimes does not work as desired.
Cheers!