This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Depricated Date class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Depricated Date class" Watch "Depricated Date class" New topic

Depricated Date class

Ajit Kanada
Ranch Hand

Joined: Jan 23, 2001
Posts: 95
When Date class is depricated and all other classes are extending from date how to get Todays Date w/o calender?

Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
The Date class is depricated because the Calendar class is more general. The answer to your question seems to be that you can't. To get todays date you would use any Calendar subclass (i.e., GregorianCalendar):

Matthew Jones
Ranch Hand

Joined: Dec 21, 2000
Posts: 68
Just because a class is deprecicated doesn't mean you can't use it, it just means that a better way of doing the same thing was developed, and it will give you a depreciation message when you compile, but the code will still work.
It is sorta covered in the JavaRanch Style Guide.
subject: Depricated Date class