How can I get difference in hours between two dates in angular2? I don't want to use external libs like moment.js
.
Having, for example: incidentTime = '2017-03-05 11:26:16 AM' and creationTime = '2017-03-06 12:26:16 AM'
let time = +params.data.incidentTime - +params.data.creationTime;
console.log("time: " + time);
It should return 25 hours, but It returns NaN
.