js获取当天00:00:00和23:59:59的时间戳

996 阅读1分钟

js获取当天00:00:00和23:59:59的时间戳,使用setHours()方法

  new Date().setHours(0,0,0,0)     // 当天00:00:00
  new Date().setHours(23,59,59,0)  // 当天23:59:59

5d19318b6412e99ced3fc6df778ff64.png