- Feature Articles
- CodeSOD
- Error'd
-
Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Even weirder is that it then converts it back to a Date object.
Admin
JavaScript does have a method to truncate to just the date part:
Edit Admin
Date object in Javascript is atrocious. I'm about ready to start using a custom type.
Edit Admin
That would be incredibly stupid. In fact, the only course of action I can think of which would be more stupid would be to use the Date object in Javascript.
Admin
You'd think that's always the case, but sometimes it's necessary. Joda-Time was created to overcome the issues with Java's Date and Calendar classes. It was later used as basis for the new Java time classes in Java 8. Without Joda-Time I'm not sure we would have gotten the new Java time classes.
Edit Admin
JavaScript has a bunch of third-party datetime libraries. Moment.js is probably the most popular, but its development has been discontinued and they're recommending others.
Admin
I concur. Let's see how everyone does on https://jsdate.wtf/
Admin
As legions of programmers have demonstrated, you can throw that information away. First you have to accept that time is an illusion and lunchtime doubly so.
Admin
It's not here yet, but the Temporal object is coming to JavaScript. This will address most of the existing problems with the original Date object. And introduce new ones, I'm sure. But there's hope on the horizon.
Edit Admin
"I scored 10/28 on https://jsdate.wtf and all I got was this lousy text to share on social media."
I bow in your general direction for spreading such a delicious demonstration of evil.
Edit Admin
That website is hilarious. Granted, these are edge cases, but god damn, Date object is much worse than I thought.
Addendum 2025-11-17 14:10: I scored 12/28 on https://jsdate.wtf and all I got was this lousy text to share on social media.
I'm so, so glad that I didn't score any higher. Although, those who scored less than me - congrats! I'm jealous of you.
Admin
I started out doing ok, but by about half way through I was getting better results by guessing randomly...