• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Yesterdays Date

 
Mary Cole
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

How do i get yesterdays date and date 30 days bk...
its urgent...
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic