如何从 JavaScript 中的这个日期对象生成月份的名称(例如:Oct/October)?
var objDate = new Date("10/11/2009");
较短的版本:
const monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]; const d = new Date(); document.write("The current month is " + monthNames[d.getMonth()]);