How to set current date to midnight in TypeScript

1 Answer

0 votes
const today = new Date();
 
today.setHours(0, 0, 0, 0);
 
console.log(today.toString()); 
   
   
   
   
/*
run:
   
"Sun Apr 10 2022 00:00:00 GMT+0300 (Israel Daylight Time)" 
   
*/

 



answered Apr 10, 2022 by avibootz
...