Announcement

Collapse
No announcement yet.

adding time to time object

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • adding time to time object

    Howdy,

    I create a future time by

    BuyDate = new Date vBarYear,vBarMonths,vBarDay,vBarHour,vBarMinutes,v BarSeconds);

    if at some point i wish to add 45 seconds to this object before this future time is reached thereby extending this future time by 45 seconds, I've not been able to find a simple, clean method.

    Any ideas would be greatly appreciated.

    Chris

  • #2
    http://forum.esignalcentral.com/show...hlight=rawtime

    has some great ideas by Alex that might help

    Comment


    • #3
      I think valueOf returns millisecs (1970) to which you add the delta and use setDate().
      But I can't find the reference I thought I had.
      For a lot of other stuff re Date I use http://www.merlyn.demon.co.uk/js-date0.htm

      Comment


      • #4
        Thanks guys .... between your two solutions I got it solved !

        Thanks,
        Chris

        Comment


        • #5
          good to hear, pls feel free to post a snippet showing your solution for future reference!

          Comment


          • #6
            Hi Dave !

            sure enough, ... seems the problem boils down to me not understanding objects ...

            solution is

            BuyDate.setSeconds(BuyDate.getSeconds() + 45);

            Chris

            Comment

            Working...
            X