一、生成时间代码
getProjectNum () {
const projectTime = new Date() // 当前中国标准时间
const Year = projectTime.getFullYear() // 获取当前年份 支持IE和火狐浏览器.
const Month = projectTime.getMonth() + 1 // 获取中国区月份
const Day = projectTime.getDate() // 获取几号
const Hour = projectTime.getHours() < 10 ? "0" + projectTime.getHours() : projectTime.getHours();//获取小时
const Date1 = projectTime.getMinutes() < 10 ? "0" + projectTime.getMinutes() : projectTime.getMinutes();//获取分钟
const Dates=projectTime.getSeconds() < 10 ? "0" + projectTime.getSeconds() : projectTime.getSeconds();//获取秒
let CurrentDate=String(Year);
if (Month >= 10) { // 判断月份和几号是否大于10或者小于10
CurrentDate += Month
} else {
CurrentDate += '0' + Month
}
if (Day >= 10) {
CurrentDate += Day
} else {
CurrentDate += '0' + Day
}
return CurrentDate+Hour+Date1+Dates;
},