Javascript: how do I add seconds to a date? [resolved]
how do I add seconds to a date?
I'm just starting to work with Javascript but I need this pretty fast.
I need to design a Javascript function that works something like VB's dateadd() function.
It only needs to do seconds so it would look something like this:
function addSeconds(myDate, Seconds)
{
//Needed Code...newDate = myDate + Seconds;
return newDate;
}
Alternately, a function that just adds xx seconds to the current date will work.
function DatePlusSecs(Seconds)
{
var myDate = new Date();
//Needed Code....newDate = myDate + Seconds;
return newDate;
}
I've been searching web sites for this but haven't found anything that i could understand/make work.