How to print the date only in Node.js

1 Answer

0 votes
const date = new Date('2025-07-18T17:19:06Z');

console.log(date.toLocaleDateString("en-US"));
 
  
  
  
/*
run:
  
7/18/2025
  
*/

 



answered Apr 4, 2022 by avibootz
...