admin管理员组文章数量:1287800
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,
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,
Share Improve this question asked Feb 22, 2012 at 18:59 GoroGoro 10.2k23 gold badges79 silver badges108 bronze badges2 Answers
Reset to default 8Necro Post!
http://momentjs./
You're wele. :P
Try this: http://www.datejs./
本文标签: javascriptIs there a library that would provide time delta functionalityStack Overflow
版权声明:本文标题:javascript - Is there a library that would provide time delta functionality? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741327729a2372584.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论