修改日期打印

This commit is contained in:
whyour
2022-06-18 12:43:23 +08:00
parent 19afbd06c0
commit 6d2edaaaf8
4 changed files with 22 additions and 29 deletions
+2 -3
View File
@@ -10,6 +10,7 @@ import { promises, existsSync } from 'fs';
import { promisify } from 'util';
import { Op } from 'sequelize';
import path from 'path';
import dayjs from 'dayjs';
@Service()
export default class CronService {
@@ -201,9 +202,7 @@ export default class CronService {
const str = err ? `\n${err}` : '';
fs.appendFileSync(
`${absolutePath}`,
`${str}\n## 执行结束... ${new Date()
.toLocaleString('zh', { hour12: false })
.replace(' 24:', ' 00:')} `,
`${str}\n## 执行结束... ${dayjs().format('YYYY-MM-DD HH:mm:ss')} `,
);
}
}