1. 获取昨天的时间戳:
const yesterday = Date.now() - 24 * 60 * 60 * 1000;
  1. 获取前天的时间戳:
const dayBeforeYesterday = Date.now() - 2 * 24 * 60 * 60 * 1000;
  1. 获取一周前的时间戳:
const oneWeekAgo = Date.now() - 7 * 24 * 60 * 60 * 1000;
  1. 获取一个月前的时间戳:
const oneMonthAgo = Date.now() - 30 * 24 * 60 * 60 * 1000;
vue实现获取 昨天前天一周前一个月前的时间戳

原文地址: https://www.cveoy.top/t/topic/ZHm 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录