Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Date Conversion  RSS feed

 
Josweth Reddy
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Frinds !!

I have a date in dd/mm/yy format.I need to add one year to this date and have to subtract one day.

Im greatful if you post your views/sugestions.

Thanks in advance,
Josweth Reddy T
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16028
87
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look at the class java.text.SimpleDateFormat for parsing a String to a Date or formatting a Date to a String.

Look at java.util.Calendar for doing calculations with dates (like adding a year, subtracting a day etc.).

(This question doesn't belong in the "Advanced Java" forum).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!