/* June 2007 FlvPlayer 8 Copyright © 2007 by Andrei Potorac andrei_potorac@yahoo.com All rights reserved. */ // ------------------------------------- // calculate the difference between two different dates // syntax: // Date.getDifference(hh,min,sec,year,month,date); // ------------------------------------- Date.prototype.getDifference = function() { var difference, endDate, retObj, endTime; endDate = new Date(); endDate.setHours(arguments[0]); endDate.setMinutes(arguments[1]); endDate.setSeconds(arguments[2]); endDate.setFullYear(arguments[3]); endDate.setMonth(arguments[4]); endDate.setDate(arguments[5]); endTime = endDate.getTime(); retObj = new Object(); difference = endTime-this.getTime(); retObj.time = difference; retObj.days = Math.round(difference/86400000); retObj.hours = Math.floor((difference-(retObj.days*86400000))/(3600000)); retObj.minutes = Math.floor((difference-(retObj.days*86400000)-(retObj.hours*3600000))/(60000)); retObj.seconds = Math.floor((difference-(retObj.days*86400000)-(retObj.hours*3600000)-(retObj.minutes*60000))/(1000)); return retObj; };