extract month from date javascript code example
Example 1: Javascript get month name
var months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
var d = new Date();
var monthName=months[d.getMonth()];
Example 2: get current date javascript full month
var Xmas95 = new Date();
var options = { month: 'long'};
console.log(new Intl.DateTimeFormat('en-US', options).format(Xmas95));
console.log(new Intl.DateTimeFormat('de-DE', options).format(Xmas95));
Example 3: get current month of year in number javascript
var today = new Date();
var month = today.getMonth();
console.log(month);