Timezones

8 thoughts
last posted March 9, 2014, 4:05 a.m.

5 earlier thoughts

0

But perhaps the most interesting subtlety I've noticed so far about this is that there are somethings such as daily streaks which are not timezone invariant. I first noticed this when GitHub and the (now down) Calendar About Nothing were reporting streaks on GitHub commits. They reported completely different numbers.

The reason is that GitHub calculated day boundaries in Pacific Time and Calendar About Nothing calculated day boundaries in UTC.

That means if I did a commit at 11 p.m. on Monday night (Pacific Time) then the next commit at 1 a.m. on Wednesday morning (Pacific Time) I would have broken my streak on GitHub (no commit on Tuesday) but continued my streak on Calendar About Nothing (a commit on Tuesday at 7 a.m. and another on Wednesday at 9 a.m.)

So a streak number is dependent on timezone. If you tried to localize that (which you may want to do: if my goal is to go to the gym everyday, I clearly mean in my timezone) then you would want to store not just the UTC time but the time in the particular timezone the person was in. You don't want a change of their timezone setting to change their streak score.

2 later thoughts