……

js 现在时间到当天24时结束

Posted on 2023-12-01 15:30  WALL*E  阅读(39)  评论(0编辑  收藏  举报

获取到时间差为毫秒,可以转为时分秒,自行处理,

getTimestamp(){
  let nowB = new Date().getTime()
  let form = new Date()
  let y = form.getFullYear();
  let m = form.getMonth()+1;
  let d = form.getDate();
  let nowE = new Date(y,m,d,"23","59","59").getTime()
  return nowE - nowB
}