aspose file tools*
The moose likes Java in General and the fly likes Yesterdays Date Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Yesterdays Date" Watch "Yesterdays Date" New topic
Author

Yesterdays Date

Mary Cole
Ranch Hand

Joined: Dec 02, 2000
Posts: 362
Hi All,

How do i get yesterdays date and date 30 days bk...
its urgent...
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

First EaseUp.

Have a look at java.util.GregorianCalendar. In particular, the getInstance() and add(int field, int amount) methods. You should be able to work it out from that.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
And, just in case it happens, don't think you're the first person who stared at the API half a day before realizing the amount could be negative.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Yesterdays Date