pa 时间处理

This commit is contained in:
fan 2022-09-23 09:20:06 +08:00
parent 22355cf11a
commit f0ee41a06c

View File

@ -427,7 +427,10 @@ export default {
if (month < 10) {
month = '0' + month;
}
const day = new Date().getDate();
let day = new Date().getDate();
if (day < 10) {
day = '0' + day;
}
this.addModel.startTime = year + '-' + month + '-' + day + ' 00:00:00';
this.addModel.endTime = year + '-' + month + '-' + day + ' 23:59:59';
this.addModel.delayTime = '00:01:00';
@ -438,10 +441,22 @@ export default {
if (month < 10) {
month = '0' + month;
}
const day = new Date().getDate();
const hour = new Date().getHours();
const minute = new Date().getMinutes();
const second = new Date().getSeconds();
let day = new Date().getDate();
if (day < 10) {
day = '0' + day;
}
let hour = new Date().getHours();
if (hour < 10) {
hour = '0' + hour;
}
let minute = new Date().getMinutes();
if (minute < 10) {
minute = '0' + minute;
}
let second = new Date().getSeconds();
if (second < 10) {
second = '0' + second;
}
this.addModel.startTime = year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second;
this.addModel.endTime = '';
this.addModel.delayTime = '';
@ -452,10 +467,22 @@ export default {
if (month < 10) {
month = '0' + month;
}
const day = new Date().getDate();
const hour = new Date().getHours();
const minute = new Date().getMinutes();
const second = new Date().getSeconds();
let day = new Date().getDate();
if (day < 10) {
day = '0' + day;
}
let hour = new Date().getHours();
if (hour < 10) {
hour = '0' + hour;
}
let minute = new Date().getMinutes();
if (minute < 10) {
minute = '0' + minute;
}
let second = new Date().getSeconds();
if (second < 10) {
second = '0' + second;
}
this.addModel.startTime = year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second;
this.addModel.endTime = '';
this.addModel.delayTime = '00:01:00';