Working with time

Results 1 to 2 of 2

Thread: Working with time

  1. #1
    Join Date
    Dec 1969

    Default Working with time

    I&#039m trying to take a time and add a certain number of minutes to it, but it keeps concatenating instead. Any ideas on how I can work with time values?

  2. #2
    Joe Mac Guest

    Default RE: Working with time

    Always convert time to it&#039s millisecond value before doing any maniplulations to it. Try this..<BR><BR>var millisecondsPerMinute = 60000;<BR>var numberOfMinutesWeWantToAdd = 4; // or what ever number needed <BR>var d = new Date();<BR>var dMilli = d.valueOf(); // convert to milliseconds.<BR>dMilii = dMilli + millisecondsPerMinute * numberOfMinutesWeWantToAdd ; // add minutes<BR>var newDate = new Date(dMilli);<BR><BR>Let me know if this works. <BR><BR>Joe<BR><BR><BR>

Posting Permissions

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