How to get the month name from a date in Node.js

1 Answer

0 votes
const date = new Date(2022, 10, 21);

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

console.log(month_name); 
   
   
   
   
/*
run:
   
November
   
*/

 



answered Jun 15, 2022 by avibootz

Related questions

1 answer 124 views
1 answer 117 views
2 answers 193 views
2 answers 143 views
1 answer 162 views
1 answer 146 views
...