Results 1 to 11 of 11

Thread: Javascript: how do I add seconds to a date? [resolved]

Threaded View

  1. #1

    Thread Starter
    Frenzied Member longwolf's Avatar
    Join Date
    Oct 2002
    Posts
    1,343

    Question 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.
    Last edited by longwolf; May 27th, 2003 at 05:47 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width