0

In my TypeScript project I get a response containing timestamps which looks like this:

  • +049235-10-18T04:13:50.000Z

This timestamp can I convert into a LocaleString which then looks like this:

  • 7.4.2017, 14:29:17

I want to get the difference between two Timestamps in seconds. The time difference between two Timestamps can be a few seconds or even days. Is there a solution for this in TypeScript?

glennsl
  • 28,186
  • 12
  • 57
  • 75
Friso
  • 127
  • 1
  • 10

1 Answers1

2

Use moment.js (http://momentjs.com/)

moment().subtract(Object);
Sergey Yarotskiy
  • 4,536
  • 2
  • 19
  • 27