📌  相关文章
📜  javascript 获取当前日期 - Javascript 代码示例

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

代码示例6
//create an object first to indicate what values you want to output
var today = new Date();
var options = {
    weekday: "long", //to display the full name of the day, you can use short to indicate an abbreviation of the day
      day: "numeric",
      month: "long", //to display the full name of the month
      year: "numeric"
}
//indicate the language you want it in first then use the options object for your values
var sDay = today.toLocaleDateString("en-US", options);