News for hackers. Stuff that matters.
Re:Dates and Times in JavaScript – A New API for Dates from ... by kcorbitt on Thursday July 09, 2020 @01:56PM (#23782988)
Check out https://www.npmjs.com/package/date-fns-tz. The API is much less intuitive than the `date-fns` one because javascript Date objects don't store their timezone, but I've used it in a real project and it's workable once you grok the mental model.
Re:Dates and Times in JavaScript – A New API for Dates from ... by sratner on Thursday July 09, 2020 @03:32PM (#23784109)
Personally, I prefer Luxon's timezone handling. I get the appeal of not providing custom classes, but _actually changing the underlying timestamp_ to adjust for timezone has always caused nothing but trouble for me. It becomes an all-or-nothing system (you must use `date-fns-tz` to manipulate the dates) with nothing to actually enforce that.