Monday, 15 July 2013

How can I calculate the time between 2 Dates in typescript -



How can I calculate the time between 2 Dates in typescript -

this works in javascript

new date()-new date("2013-02-20t12:01:04.753z")

but in typescript can't rest 2 new dates

date("2013-02-20t12:01:04.753z")

don't work because paremater not match date signature

use gettime method time in total milliseconds since 1970-01-01, , subtract those:

var time = new date().gettime() - new date("2013-02-20t12:01:04.753z").gettime();

date typescript

No comments:

Post a Comment