programming-examples/js/Date/Write a JavaScript function to get a full textual representation of a month, such as January or June..js
2019-11-15 12:59:38 +01:00

12 lines
361 B
JavaScript

Date.longMonths = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
function full_month(dt)
{
return Date.longMonths[dt.getMonth()];
}
dt = new Date();
console.log(full_month(dt));
dt = new Date(2015, 10, 1);
console.log(full_month(dt));