Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a library that would provide time delta functionality?

Is there a JavaScript library that would provide functionality of a "time difference" object?

For example, let's say I have:

time1 = Date(...)
time2 = Date(...)

timeDelta = time2 - time2

By default that just gives me milliseconds, which I can work with, but it would be nice to already have something available so I dont have to re-invent the wheel. What I'm shooting for is something like this:

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

Any suggestions?

Thanks,

like image 801
Goro Avatar asked Dec 16 '22 03:12

Goro


1 Answers

Necro Post!

http://momentjs.com/

You're welcome. :P

like image 189
AlbertEngelB Avatar answered Dec 28 '22 23:12

AlbertEngelB