How To add a day in user provided DATE
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Mangesh_Kulkarni
Posted On:   Tuesday, September 5, 2006 01:54 AM

Hi, Can we add a day in a date, provided by user.if s then how?

means i will give : 2006 09 30 for eg
and output should be 2006 10 01

Please tell.

Thanks

Re: How To add a day in user provided DATE

Posted By:   Firat_Tiryaki  
Posted On:   Tuesday, September 5, 2006 04:52 AM

You can simply add one day to it, one day is 86400000 miliseconds, so check the below code



Date dd=new Date();
dd.setTime(dd.getTime()+86400000);



dd is one day later than the current time.

Re: How To add a day in user provided DATE

Posted By:   Jani_Kaarela  
Posted On:   Tuesday, September 5, 2006 02:23 AM


Check out java.util.Calendar. And next time, search the API before posting - it would have been pretty trivial to read up on Date and find the "See also" link to Calendar...

About | Sitemap | Contact