📜  3 个字母月份的 javascript 数组 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:23.898000             🧑  作者: Mango

代码示例1
var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
var today = new Date();

// Show date in "dd-mm-yyyy' format.
var d = today.getDate();
var m = months[today.getMonth()];
var y = months.getFullYear();

console.log(d + "-" + m + "-" + y);