export function getCurrentMonthLast() {
let date = new Date();
let lastDay = new Date(date.getFullYear(), date.getMonth() + 1, 0);
let year = lastDay.getFullYear();
let month = lastDay.getMonth() + 1;
let strDate = lastDay.getDate();
if (month >= 1 && month <= 9) {
month = “0” + month;
}
if (strDate >= 0 && strDate <= 9) {
strDate = “0” + strDate;
}
let lastDate = year + “-” + month + “-” + strDate;
return lastDate;
}
获取当前月最后一天
最新推荐文章于 2024-05-15 22:33:17 发布