jQuery/JS - How to compare two date/time stamps?

前端 未结 5 872
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-10 18:53

I have two date/time stamps:

d1 = 2011-03-02T15:30:18-08:00 
d2 = 2011-03-02T15:36:05-08:00

I want to be above to compare the two:

5条回答
  •  心在旅途
    2020-12-10 19:32

    Given the differences in date formats and capability between browsers, I'd really reccomend you use a library devoted to DateTime handling. JS support for it is notoriously horrendous. I'm a HUGE fan of date.js

    http://www.datejs.com/

提交回复
热议问题