function getCurrentDate() {
var d = new Date(),
month = '' + (d.getMonth() + 1),
day = '' + d.getDate(),
year = d.getFullYear();
if (month.length < 2) month = '0' + month;
if (day.length < 2) day = '0' + day;
return [year, month, day].join('-');
}
javascript 获取当前日期(YYYY-MM-DD)
最新推荐文章于 2024-07-17 16:40:32 发布