js获取当前时间是本年的第几天第几周

it2022-05-09  63

let d1 = new Date() let d2 = new Date() d2.setMonth(0) d2.setDate(1) let rq = d1-d2 let s1 = Math.ceil(rq/(24*60*60*1000)) let s2 = Math.ceil(s1/7) console.log('第' + s1 + '天,第' + s2 + '周')

转载于:https://www.cnblogs.com/wangqiao170/p/9282384.html


最新回复(0)