How to obtain difference in minutes between two raw dates in javascript? i.e. to use as '2 minutes ago', '10 minutes ago', etc.
By RAW I mean this format -> 2015-02-05T03:11:33.301Z (var x = new Date())
This is what I have but I always get NaN in the return value...
function getMinutesBetweenDates(startDate, index) {
var endDate = new Date();
var diff = endDate - startDate;
return (diff / 60000);
}
Thanks for your help.
' minutes ago'
. – RobG(startDate instanceof Date)
? – neouser99