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 252 views
1 answer 215 views
2 answers 334 views
2 answers 290 views
1 answer 269 views
1 answer 263 views
...