javascript get month january 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: javascript getmonth
new Date().getMonth();
Example 3: 3 letter months javascript array
var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
var today = new Date();
var d = today.getDate();
var m = months[today.getMonth()];
var y = months.getFullYear();
console.log(d + "-" + m + "-" + y);
Example 4: 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));