jQuery in Action, 2nd edition*
The moose likes Beginning Java and the fly likes When to use Date and when to use calendar? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "When to use Date and when to use calendar?" Watch "When to use Date and when to use calendar?" New topic
Author

When to use Date and when to use calendar?

jacob deiter
Ranch Hand

Joined: Apr 02, 2008
Posts: 576
When to use Date and when to use calendar?

Since both are used for data manipulations only?
Freddy Wong
Ranch Hand

Joined: Sep 11, 2006
Posts: 959

You shouldn't use Date for date manipulation. Most of the methods there have already been deprecated.


SCJP 5.0, SCWCD 1.4, SCBCD 1.3, SCDJWS 1.4
My Blog
James Dixon
Ranch Hand

Joined: Jun 20, 2009
Posts: 32
Hi Jacob

If you look at the java docs it gives you quite a good explanation about the differences between the two:
Date
Calendar

Personally I wouldn't use either. Joda Time is a lot more developer friendly for any time/date manipulation you want to do.
jacob deiter
Ranch Hand

Joined: Apr 02, 2008
Posts: 576
Most of the methods there have already been deprecated.


why it is depreciated?
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Beause there is better support for date manipulation in the Calendar class.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: When to use Date and when to use calendar?