News for hackers. Stuff that matters.
Re:Simple, correct, fast: in that order by s3m4j on Monday July 09, 2018 @10:26AM (#17490364)
In my experience, it's been easier to push UTC time all the way from the db to the user javascript and operate on time then, than trying to manipulate time before sending to the user. YMMV, and it's only web dev.
Re:Simple, correct, fast: in that order by marcosdumay on Monday July 09, 2018 @10:33AM (#17490414)
There are many kinds of data that get saved as time. For some, yes, it's better to add and remove the TZ at the interface. For some the TZ carries meaning by itself, and it must be stored and keep constant everywhere. For some the TZ carries meaning, but the time must be converted for display.

Know your data, and most of your problems get easy.

Re:Simple, correct, fast: in that order by everybodyknows on Monday July 09, 2018 @06:29PM (#17493928)
Yes, that's the crucial distinction -- whether the TZ, with its coarse encoding of the geography of origin, carries significance to the consumer of the data.
Re:Simple, correct, fast: in that order by taeric on Monday July 09, 2018 @10:30AM (#17490394)
This works for things that have happened. It doesn't work too well for schedules. In those cases, the timezone of the source matters, heavily.
Re:Simple, correct, fast: in that order by majewsky on Monday July 09, 2018 @10:43AM (#17490494)
For example, a task that occurs "daily at 15:00" does not always happen every 24 hours. When DST comes into effect, the interval shortens to 23 hours once.
Re:Simple, correct, fast: in that order by falcolas on Monday July 09, 2018 @03:13PM (#17492658)
Or, at "2:30 am" in the continental US can occur twice in a day, or not at all. Of course, even that isn't guaranteed, if you're in AZ.

Even "notify me in exactly 24 hours has its own complications. Leap seconds will screw up your day (as will the vague request of "exactly 24 hours").

Corner cases, the bane of simplicity everywhere.

Re:Simple, correct, fast: in that order by s3m4j on Monday July 09, 2018 @02:34PM (#17492367)
To this day, knock on wood, I have had success at voluntarily avoiding those issues ^^ (aside from school assignements)