addDate() {
var nowDate = new Date();
var date = {
year: nowDate.getFullYear(),
month: nowDate.getMonth() + 1,
day: nowDate.getDate(),
}
var systemDate = date.year + ‘-’ + (date.month >= 10 ? date.month : ‘0’ + date.month) + ‘-’ + (date.day >= 10 ? date.day : ‘0’ + date.day)
console.log(systemDate);
}

Logo

前往低代码交流专区

更多推荐