📜  js 中的 dateTime 日期 - 无论代码示例

📅  最后修改于: 2022-03-11 14:55:07.788000             🧑  作者: Mango

代码示例2
var currentDate = new Date();

var date = currentDate.getDate();
var month = currentDate.getMonth(); //Be careful! January is 0 not 1
var year = currentDate.getFullYear();

var dateString = date + "-" +(month + 1) + "-" + year;