This week's book giveaway is in the JavaFX forum.
We're giving away four copies of Introducing JavaFX 8 Programming and have Herbert Schildt on-line!
See this thread for details.
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

Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
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: 14991

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!