Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

calculate todays date minus last one year in java

 
Abhishek Shirodkar
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All

how do i calculate todays date minus last one year in java.


Thanks in advance
 
James Sabre
Ranch Hand
Posts: 781
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Abhishek Shirodkar wrote:Hello All

how do i calculate todays date minus last one year in java.


Thanks in advance


Take a look at java.util.GregorianCalendar and the add() method.

P.S. You are allowed to add negative amounts!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic