1

I have an app that includes a navigation history function. I'm trying to find the best way to display the timestamps of history events in the case when the user changes time zones. Each timestamp is of course stored in UTC, and the list is usually grouped by day.

Should I:

  1. Always display the timestamp of each history event in local time, and group by days in local time? This means it's possible to generate an event and then travel across a time zone boundary and have it show up in a different day than it did when it was created.
  2. Display the timestamp of each history event in local time of the time zone it was created in?
  3. Display the timestamp in local time but group by the calendar day in the time zone where the event was created?
  4. Other?

Along with the unix timestamp, each event also stores a days property which is (timestamp + timeZoneOffsetInSeconds) / secondsPerDay where secondsPerDay is 86400. I can group by that to achieve option 3 above.

  • Is it possible to share what kind of data it is? The question whether the following sentence is an issue depends on what data it is: This means it's possible to generate an event and then travel across a time zone boundary and have it show up in a different day than it did when it was created Let's say that an event happens on Tuesday, Oct 3, at 8 PM in NY City (UTC-4). If I as a user look at the history in London (currently UTC+1, so it's Oct 4, 1am), would it matter that it's grouped under Oct 4? From Londoner's point of view it really did happen on Wednesday... – Jaroslav M Oct 3 '17 at 13:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.