This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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
 
Similar Threads
how can i get yesterdays date?
how to get yesterdays date using jsp
Caluculating Yesterdays date based on the current date
yesterdays date
SimpleDateFormat