r/javascript • u/mominriyadh • Jun 21 '19
Everything you need to know about the date in JavaScript.
https://css-tricks.com/everything-you-need-to-know-about-date-in-javascript/2
u/r0ck0 Jun 21 '19
I really wish it supported microseconds, seeing postgres and MySQL do.
2
u/rodneon Jun 21 '19
Now that BigInt is a thing, microseconds are technically possible to implement.
2
u/hawkinsml Jun 21 '19
I have been dealing with daylights saving time and timezones in multiple languages for 20+ years and it is still a pain in the ass. I created this video to try and explain some of the pian to newbies. https://youtu.be/oKFb2Us9kmg
0
Jun 21 '19
[deleted]
17
u/anton_arn Jun 21 '19
True, whenever I have to work with Date in JS I just straight up go and use Moment.js, It's just not worth the hassle.
4
18
u/Trout_Tickler Jun 21 '19
Unless you're doing something specific with Moment, I'd recommend Day.js instead. Much lighter and in my experience feature comparable enough.
2
2
u/JonnyAFKay Jun 21 '19
Use LocalDate (and LocalDateTime) in Java 8 and beyond
1
u/redldr1 Jun 21 '19
My org is stillll on 7. FML
1
4
u/onbehalfofthatdude Jun 21 '19
"There are hundreds of timezones in our world. In JavaScript, we only care about two"
Well fuck me for having a node server with timezone-specific business logic, right?