This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Java in General and the fly likes Add 1 day to a date? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Add 1 day to a date?" Watch "Add 1 day to a date?" New topic

Add 1 day to a date?

myron schabe

Joined: Aug 21, 2002
Posts: 19
How do I add just one day to a Date object?
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63870

Do a search through these forums. This topic has been covered numerous times, and quite recently as well.

[Asking smart questions] [About Bear] [Books by Bear]
David Duran
Ranch Hand

Joined: Feb 11, 2002
Posts: 122
I didn't try compiling this but:
GregorianCalendar cal = new GregorianCalendar()
cal.add(Calendar.DAY_OF_MONTH, 1);
Date d = cal.getTime();
If you have your own Date object perhaps passed in as a parameter then you can set the time:
I agree. Here's the link:
subject: Add 1 day to a date?
It's not a secret anymore!