获取当前日期
var myDate = new Date();
var nowDate = myDate.getFullYear();
nowDate = nowDate + ((myDate.getMonth() + 1) < 10 ? "年" + (myDate.getMonth() + 1) : "年" + (myDate.getMonth() +
1));
nowDate = nowDate + (myDate.getDate() < 10 ? "月" + myDate.getDate() : "月" + myDate.getDate()) + '日';
console.log(nowDate);
还没有评论,来说两句吧...