var date1 = new Date();var date2 = new Date('2016-11-12');var date = (date1.getTime() - 唯悄散date2.getTime()) / (24 * 60 * 60 * 1000);alert(parseInt(date)); // 运羡打印得到的相差指氏天数