5 ms·
JS Dates are terrible, but not just the native stuff...there isn't a single good library either. [1] A good library instants (1582852000000 ms since epoch), du
by paulddraper 7y ago
JS Dates are terrible, but not just the native stuff...there isn't a single good library either. [1]
A good library instants (1582852000000 ms since epoch), durations (5000 ms), periods (2 months), offsets (-0700), timezones (America/Denver), date (4/3/2019), and time (4:45 PM).
Instead I am stuck with good treatment of like two or three of these in any JS library I pick up -- usually instant and duration -- and I have to hammer things to fit.
[1] https://news.ycombinator.com/item?id=21669829 https://news.ycombinator.com/item?id=21669829
- jasonkillian 7y agoI've found js-joda is a good JS datetime library: https://github.com/js-joda/js-joda https://github.com/js-joda/js-joda
- paulddraper 7y agoInteresting, thanks! I've used Joda and java.time a lot, and I have a very high opinion of both.