MVC5
I'm looking to compare enddate and startdate for a booking to find the total number of hours in between. Datetime is in format of DD/MM/YYYY HH:MM
var hours = (endDate - startDate).TotalHours;
alert('Total Hours Difference ' + hours);
Output is showing "Total Hours Difference UNDEFINED"
WORKING SOLUTION
startDate = parseInt(new Date(startDate).getTime() / 1000);
endDate = parseInt(new Date(endDate).getTime() / 1000);
var timeDiff = (endDate - startDate) / 3600; // will give difference in hrs
alert('Total Hours Differece' + timeDiff);