jweinst1
11/24/2015 - 2:57 AM

time object functions in javascript.

time object functions in javascript.

//js time object

//returns the milisecond difference between two times
function subtimes(time1, time2) {
    var difference = time2.getTime() - time1.getTime();
    return difference;
}

//returns the sum of miliseconds between two times.
function addtimes (time1, time2) {
    var sum = time1.getTime() + time2.getTime();
    return sum;
}