日期:2014-05-16 浏览次数:20392 次
//输入时间早于当前系统时间 function smallerThanNow(time){ var myDate = new Date(); //2012年12月30日 13:13:00 var now = myDate.toLocaleDateString()+" "+myDate.toLocaleTimeString(); //2012-12-30 13:13:00 now = now.replace("年","-").replace("月","-").replace("日",""); now = new Date(now.replace(/-/g, "/")); //2012/12/30 13:13:00 time = new Date(time.replace(/-/g, "/")); if(time==null || Date.parse(time) - Date.parse(now) < 0){ return true; }else{ return false; } }