function CompareDate(t1,t2)
{ var date = new Date(); var a = t1.split(":"); var b = t2.split(":"); return date.setHours(a[0],a[1]) > date.setHours(b[0],b[1]); } 调用: alert( CompareDate("12:00","11:15") );本文共 252 字,大约阅读时间需要 1 分钟。
function CompareDate(t1,t2)
{ var date = new Date(); var a = t1.split(":"); var b = t2.split(":"); return date.setHours(a[0],a[1]) > date.setHours(b[0],b[1]); } 调用: alert( CompareDate("12:00","11:15") );转载于:https://www.cnblogs.com/sx00/p/10914025.html