// 改正 var today = new Date(2017, 1, 14, 13, 14, 00, 000); //today需要指定时间不然获取的时间是当前计算机的时间 if (today.getMonth() === 1 && today.getDate() === 14) { alert('亲爱的,我预定了晚餐,晚上6点在餐厅见!'); } // 因为月份从0开始,2是三月份,1才是真正的二月份
我的女朋友呢?
修正一下 let today = new Date(2017, 1, 14, 13, 14, 10, 100);
在非严格模式下,可以使用0(零)开头前缀声明8进制。 但是在严格模式下,会产生错误。
多写代码,也要多出去走走
Sign in to make a reply
ApacheTomCat