日期:2014-05-16  浏览次数:20348 次

js比较2个时间大小
var x=new Date();
 x.setFullYear(2100,0,14);
var today = new Date();

 if (x>today)
   {
   alert("Today is before 14th January 2100");
   }
 else
   {
   alert("Today is after 14th January 2100");
   }


js设置时间几天后的:
var myDate=new Date();
 myDate.setDate(myDate.getDate()+5);