- Instant help with your JavaScript coding problems

Get month name from Date in JavaScript

Question:
How to get month name from Date in JavaScript?
Answer:
let now = new Date();

let monthName = now.toLocaleString('default', { month: 'long' });

console.log('The month is: ' + monthName);
Description:

The toLocaleString() method returns a string with a language sensitive representation of this date.

The new locales and options arguments let applications specify the language whose formatting conventions should be used and customize the behavior of the function.

Share "How to get month name from Date in JavaScript?"