How js acquisition start time and end time of today's date

js get today's date of the start time and end time, is from 0: between 59: 00: 00-23: 59

So what is the specific way to obtain it? No nonsense, directly on the code

let daySart=new Date(new Date(new Date().toLocaleDateString()).getTime())
let dayEnd=new Date(new Date(new Date().toLocaleDateString()).getTime() + 24 * 60 * 60 * 1000 - 1)
console.log(daySart);
console.log(dayEnd);

  

Guess you like

Origin www.cnblogs.com/agen-su/p/12014880.html