How to get the month name from a date in TypeScript

1 Answer

0 votes
const date = new Date(2022, 7, 13);

const month_name = date.toLocaleString('default', { month: 'long' });

console.log(month_name); 
   
   
   
   
/*
run:
   
"August" 
   
*/

 



answered Jun 15, 2022 by avibootz
...