functiongetTime() { let week = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"]; let localToday = ""; let d = newDate(); // console.log(d) localToday = d.getFullYear() + "年" + (d.getMonth() + 1) + "月" + d.getDate() + "日"; let time = ""; let hh = d.getHours(); //时 let mm = d.getMinutes(); //分 let ss = d.getSeconds(); //秒 if (hh < 10) time += "0"; time += hh + ":"; if (mm < 10) time += "0"; time += mm + ":"; if (ss < 10) time += "0"; time += ss; return { 0: localToday, 1: week[d.getDay()], 2: time }; }