jQuery calcule a diferença de tempo

 // will return number of days
function calculateDT() {
            var oneD = 1000 * 60 * 60 * 24;
            var startDT = ($("#ETDsdt").val());
            var endDT = ($("#ETDedt").val());
            var sMS = new Date(startDT);
            var eMS = new Date(endDT);
            return Math.round((eMS.getTime() - sMS.getTime()) / oneD);
        }
BlackSwan