获取当前时间,日期格式function currentDate() { var date = new Date(); var y = date.getFullYear(); var m = date.getMonth() + 1; // m = m < 10 ? ('0' + m) : m; var d = date.getDate(); // d = d < 10 ? ('0' + d) : d; var h = date.getHours(); // h = h < 10 ? ('0…
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 + '周')…