var monthNames = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]; var date = new Date(); var day = date.getDate(); var monthIndex = date.getMonth(); var year = date.getFullYear(); console.log(day, monthNames[monthIndex], year); document.write(day + ‘ ‘ + monthNames[monthIndex] + ‘ ‘ + year);
请将 monthNames 中的数组改为你想要的
时间: 2024-10-01 20:31:55