0

Suppose I have two timestamp:

var timestamp1=Date.now();
var timestamp2=Date.now();

and we know that timestamp1

poopp
  • 1,297
  • 2
  • 13
  • 23
  • There are plenty solution online, just need to dig a bit [here](http://stackoverflow.com/questions/3224834/get-difference-between-2-dates-in-javascript) – ga.breban Nov 10 '16 at 14:28
  • In what units do you expect the difference/distance? – gus27 Nov 10 '16 at 14:28
  • If you want the difference in years, months, days, etc. you might also want to look at the answers here: [*How to get the difference of two dates in mm-dd-hh format in Javascript*](http://stackoverflow.com/questions/35504942/how-to-get-the-difference-of-two-dates-in-mm-dd-hh-format-in-javascript/35520995#35520995). It's not a simple task as years, months and days do not have a consistent length, differences are not necessarily symmetric and there are a couple of business rules that may vary depending on local preferences. – RobG Nov 11 '16 at 06:25

0 Answers0