function getCurrentDate(){
const nowDate = new Date();
const date = {
year: nowDate.getFullYear(),
month: nowDate.getMonth() + 1,
date: nowDate.getDate(),
};
const newmonth = date.month >= 10 ? date.month : "0" + date.month;
const day = date.date >= 10 ? date.date : "0" + date.date;
return date.year + "-" + newmonth + "-" + day;
}
js获取当前日期
获取当前日期的JavaScript函数详解
最新推荐文章于 2023-05-16 14:12:36 发布
1540

被折叠的 条评论
为什么被折叠?



