Javascript Date Plus 2 Weeks (14 days) -


i use date:

var currenttime = new date() var month = currenttime.getmonth() + 1 var day = currenttime.getdate() var year = currenttime.getfullyear() alert(month + "/" + day + "/" + year); 

how can add 2 weeks ? instead of showing 10/13/2011, show 10/27/2011 etc

here fiddle: http://jsfiddle.net/25wna/

i want 1 input have +14 days , other +21

note: i'd format > 10/13/2011 <.

12096e5 magic number 14 days in milliseconds.

var fortnightaway = new date(+new date + 12096e5); 

jsfiddle.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -