zzl00770

导航

js 比较两个日期的大小

function tab(date1,date2){
    var oDate1 = new Date(date1);
    var oDate2 = new Date(date2);
    if(oDate1.getTime() > oDate2.getTime()){
        console.log('第一个大');
    } else {
        console.log('第二个大');
    }
}
tab('2015-10-10','2015-10-11');

 

posted on 2024-01-22 17:56  品味人生nuiapp  阅读(4)  评论(0编辑  收藏  举报