You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on the Time Value Component (#36), I stumbled across some interesting behavior and I'm wondering if it will have an affect later on with other programming languages.
The potential issue
When submitting time values with a rather old date, the timestamp that is stored looks incorrect but when converted to the local timezone, what the user see's is correct.
For example:
To clarify this next part, positive offset value are returned as a negative value and in minutes, so our offset from UTC is -120 (or 2 hours ahead).
When I save this value and get the value back I would expect the timestamp to be
"1776-07-04T18:00:00.000Z" accounting for our -120 offset from UTC. However what we get back is
"1776-07-04T19:25:52.000Z" with an offset of -34
When you refresh the page, the time value that is shown to the user is "20:00", again accounting for our -120 offset from UTC, which is correct.
However, if you submit a rather recent date, the timestamp that is stored looks exactly how it should and when it is converted to the local time zone, it is also correct.
For example:
When I save this value, the timestamp I get back from the value is "2019-07-04T18:00:00.000Z" with an offset of -120 which is exactly what I had entered into the form.
I fully acknowledge that I don't fully understand what this offset magic is doing and why is changes so drastically for older dates but I just wanted to raise the awareness to this because maybe this offset magic is specific to Javascript and other programming languages will struggle with it or maybe it won't be an issue at all :)
The text was updated successfully, but these errors were encountered:
While working on the Time Value Component (#36), I stumbled across some interesting behavior and I'm wondering if it will have an affect later on with other programming languages.
The potential issue
When submitting time values with a rather old date, the timestamp that is stored looks incorrect but when converted to the local timezone, what the user see's is correct.
For example:
To clarify this next part, positive offset value are returned as a negative value and in minutes, so our offset from UTC is -120 (or 2 hours ahead).
When I save this value and get the value back I would expect the timestamp to be
"1776-07-04T18:00:00.000Z" accounting for our -120 offset from UTC. However what we get back is
"1776-07-04T19:25:52.000Z" with an offset of -34
When you refresh the page, the time value that is shown to the user is "20:00", again accounting for our -120 offset from UTC, which is correct.
However, if you submit a rather recent date, the timestamp that is stored looks exactly how it should and when it is converted to the local time zone, it is also correct.
For example:
When I save this value, the timestamp I get back from the value is "2019-07-04T18:00:00.000Z" with an offset of -120 which is exactly what I had entered into the form.
I fully acknowledge that I don't fully understand what this offset magic is doing and why is changes so drastically for older dates but I just wanted to raise the awareness to this because maybe this offset magic is specific to Javascript and other programming languages will struggle with it or maybe it won't be an issue at all :)
The text was updated successfully, but these errors were encountered: