How to get the month name from a date in JavaScript

1 Answer

0 votes
const date = new Date(2022, 6, 15);

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

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

 



answered Jun 15, 2022 by avibootz

Related questions

1 answer 136 views
1 answer 136 views
2 answers 162 views
1 answer 142 views
1 answer 160 views
1 answer 120 views
...