I want to get a date which is n days previous to the current date. I want to do it without using the Calender Objet but just by using java.util.Date.
Can any body please help.
Joined: Jun 19, 2001
Why do you want to do this without Calendar ?
Date has a constructor taking a long argument which is the number of milliseconds sinse 1.1.1970 (see javadoc). And if you have a Date X where you want to subtract 1 day, then its: oldDate in millis - 1000 * 60 * 60 * 24
make sure the multiplication does not exceed the int range!
Joined: Apr 27, 2006
I want to do this stuff in the java script .Can you please advice me how to do it?.