File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Date Conversion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Date Conversion" Watch "Date Conversion" New topic

Date Conversion

Josweth Reddy
Ranch Hand

Joined: Nov 02, 2005
Posts: 30
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
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15081

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).

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
I agree. Here's the link:
subject: Date Conversion
It's not a secret anymore!