获取当前时间
let now = new Date();
获取三天前时间
let threeNow = new Date(now.getTime() - 24*60*60*1000*3);
时间格式化
let nowStr = now.format("yyyy-MM-dd hh:mm:ss");
let threeStr = threeNow.format(`yyyy-MM-dd hh:mm:ss`);
获取几天前几天后的时间并格式化
猜你喜欢
转载自www.cnblogs.com/qihang0/p/12557886.html
今日推荐
周排行