Hi all,
I am working on a project which is used in multiple timezones and I can't wrap my head around a localized view of a DateTime attribute. Can someone please explain? Thanks in advance!
Imagine two users: user 1 is in the Netherlands and has user timezone (GMT +01:00) Amsterdam. User 2 is in Canada and has user timezone (GMT -08:00) Vancouver. We are currently in daylight saving time (Amsterdam = UTC +02:00, Vancouver = UTC - 07:00). User 1 sets the value of a localized DateTime attribute to BeginOfCurrentDay. The attribute has these values:
UTC time: 2017-09-25 22:00:00.000
Session time: 2017-09-26 00:00:00.000 +0200
A view of the attribute in the session of user 1 shows 2017-09-26 12AM, as expected. Now user 2 logs in and observes the DateTime attribute. The attribute has these values:
UTC time: 2017-09-25 22:00:00.000
Session time: 2017-09-25 15:00:00.000 -0700
A view of the attribute in the session of user 2 shows 2017-09-26 12AM. This is not what i expect at all! I expect the value to be shown as 2017-09-26 3PM. Why does the view show 12 AM instead of 3PM?
Four additional notes:
- The default 'Export grid to Excel' button generates a file in which the DateTime DOES show 2017-09-26 3PM.
- A formatDateTime also results in 2017-09-26 3PM
- I figured this might have something to do with the DatePicker widget. To verify this, I also created a button which invokes a microflow that sets the attribute to BeginOfCurrentDay. A localized view of this value also shows 2017-09-26 12AM.
- I log in with both user 1 and user 2 on my laptop with OS timezone set to (GMT +01:00) Amsterdam.