Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

java-date 1

Status
Not open for further replies.

overflo

Technical User
Feb 10, 2003
70
AU
I need a method that will return a date 14 days from today. New to java. Any help appreciated.
 
new java.sql.Date(System.currentTimeMillis()+(86400000*14))
java.sql.Date class has a constructor with long parameter.
To find the "today" we put the System.currentTimeMillis() method.But since you want the 14 days ahead, then you should calculate it in milliseconds.One day is 86400000 mseconds and System.currentTimeMillis()+(86400000*14) is your desired result.

Salih Sipahi
Software Engineer.
City of Istanbul Turkey
s.sipahi@sahinlerholding.com.tr
turkey_clr.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top