• Hanzito (unregistered)

    Even weirder is that it then converts it back to a Date object.

  • Zatapatique (unregistered)

    JavaScript does have a method to truncate to just the date part:

    event.setHours(0, 0, 0, 0);
    
  • (nodebb)

    Date object in Javascript is atrocious. I'm about ready to start using a custom type.

  • (nodebb) in reply to Mr. TA

    I'm about ready to start using a custom type.

    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.

  • Rob (unregistered)

    That would be incredibly stupid.

    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.

  • (nodebb)

    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.

  • Someone (unregistered) in reply to dpm
    Comment held for moderation.
  • Deeseearr (unregistered)
    Comment held for moderation.

Leave a comment on “In the Zone”

Log In or post as a guest

Replying to comment #:

« Return to Article