Link to home
Start Free TrialLog in
Avatar of billy21
billy21

asked on

DateAdd Function

How do I add days to a date in javascript?  What I want to do is simply add 7 days to a date.

Also can I convert a string to a date?  the date I'll be using will be coming in as a string formatted dd mmm yyyy

Thanks in advance,

Bill
ASKER CERTIFIED SOLUTION
Avatar of amg42
amg42

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of billy21
billy21

ASKER

The <BR> things appear to be html.  I get a syntax error.  My function looks like this...


function MoveRight()
{
      var d = document.all;
      
      var dt = new Date(d.hidStartDate.value);<BR>
      with (dt) {<BR>     setDate(getDate() + 7);<BR>}
      
      
      
}
Avatar of billy21

ASKER

OIC the <BR> things seem to be a result of copying and pasting and nothing more.

Works fine.  Thanks amg.