Hacker News new | ask | show | jobs
by jenseng 4695 days ago
UTC offset is well and good if you are talking about today, but as soon as you start displaying past or future datetimes, DST will bludgeon you over the head.

And depending on your app, users might want control over the timezone. When a teacher creates an assignment in canvas-lms, the due date defaults to midnight of the selected day. It would be surprising if it set it to 2am, just because the teacher happened to be traveling when the assignment was created.

1 comments

Exactly. I have run into this problem with event calendars. For example: Schedule a recurring event for 1pm. It happens to be EDT at the moment so you store the event date/time in UTC by adding 5 hours. Then, in days, weeks, or months, we change to EST. The 1pm meeting is now showing at noon.

To fix this I run a cron job on the ST/DT boundaries that increments or decrements stored date/times in the event calendar.