- 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.