Manning's Countdown to 2014
. Use discount code crdotd14 all month for 50% off every deal.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
add days to date
Joined: Sep 01, 2006
Jan 22, 2009 02:44:20
Is there any simple way to add to a Date object 3 days.
I trie to get the milisecons from the date and then create a new date with the miliseconds from the original date adding the miliseconds of threee day but I think there would be something easier.
Joined: Feb 19, 2008
Jan 22, 2009 02:52:03
Use Calendar class, It has roll() and add() methods , which helps to add() specific field by some value you want. The fields are like DATE, MONTH , etc..
Have look at
Calendar class API
for detailed story !
[Freelance Web Designer]
[and "Rohan" is part of my surname]
subject: add days to date
Problem with age script
delete logfiles that are older than 3 months
Milliseconds to date conversion
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013