Himu\’s Attempt at Blogging

Tidbits from my thoughts

Java Date is so stupid

with 2 comments

Everytime I try to work with java.util.Date, I get frustrated. Why is the API so cumbersome?

Have you ever tried to find the difference between to Date values? There is nothing except a millisecond value. I don’t want milliseconds! I want rounded days and the timestamp comes to taunt me!

Why can’t you simply add to or subtract from a Date? I don’t want to handle multiple Calendar objects when working with multiple Date values simultaneously. It just bloats the code!

I cannot instantiate a specific Date if I want to. Go through Calendar again? But why??

Maybe you will tell me about various design issues. But I don’t want to bother. I just want a simple interface for manipulating Date values.

Advertisements

Written by mhimu

December 19, 2007 at 1:59 pm

Posted in Java

Tagged with ,

2 Responses

Subscribe to comments with RSS.

  1. Definitely check out Joda Time.

    http://joda-time.sourceforge.net/

    You’ll never be able to go back to using Java Date/Calendar classes after trying it…

    Kevin

    December 21, 2007 at 3:26 pm

  2. Looks promising!

    mhimu

    December 26, 2007 at 10:39 am


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: