let now = new Date();
let Now = now.getTime(); //当前时间戳
let nowYear = now.getFullYear(); //当前年
let nowMonth = now.getMonth();//当前月
let nowDay = now.toLocaleDateString();//当前天
let firstDay = new Date(nowYear, nowMonth, 1).getTime()//本月开始时间戳
let LastDay = new Date(nowYear, nowMonth + 1, 0).getTime(); // 本月结束时间戳
let Day = new Date(nowDay).getTime(); // 当天0点时间戳
let yesterday = new Date(nowDay).getTime() - 86400000; // 昨天时间戳, 86400000为24h的时间戳
let beforeYesterday = new Date(nowDay).getTime() - 86400000 * 2; // 前天时间戳
网友评论