js 获取每月最后一天
作者:互联网
let y = new Date().getFullYear()
let m = new Date().getMonth() + 1
let lastDay = new Date(y, m, 0).getDate()
console.log('lastDay: ', lastDay); // lastDay: 31
let date = y + '-' + m + '-' + lastDay
console.log('date: ', date); // date: 2022-5-31
标签:console,Date,每月,js,获取,let,new,date,lastDay 来源: https://www.cnblogs.com/mysn/p/16313222.html