let fdate = new Date()
let fyears = fdate.getFullYear()
let fmoths = fdate.getMonth()
let fdate_sgy = new Date(fyears, fmoths - 1, fdate.getDate())//上个月的今天
console.log(dayjs(fdate_sgy).format('YYYY-MM-DD'))
dayjs 获取上个月的今天
最新推荐文章于 2024-03-26 17:04:06 发布