How to print the date only in TypeScript

1 Answer

0 votes
const date = new Date('2021-03-25T17:19:06Z');

console.log(date.toLocaleDateString("en-US"));

 
  
  
  
/*
run:
  
"3/25/2021" 
  
*/

 



answered Apr 4, 2022 by avibootz

Related questions

2 answers 169 views
...