Is there a library that provides temporary delta functionality?

Is there a JavaScript library that provides the functionality of an object with a time difference?

For example, let's say I have:

time1 = Date(...) time2 = Date(...) timeDelta = time2 - time2 

By default, it just gives me milliseconds that I can work with, but it would be nice to have something available already, so I don't need to reinvent the wheel. What I'm shooting is something like this:

 timeDelta.hours // would give the number of hours between time2 and time1 time1 + timeDelta // would equal time2 

Any suggestions?

Thanks,

+4
source share
2 answers

Necro Post!

http://momentjs.com/

Welcome .: P

+8
source

Try the following: http://www.datejs.com/

+4
source

Source: https://habr.com/ru/post/1397874/


All Articles