From fa3d2503f8c34049159058a19e941192e47fb89e Mon Sep 17 00:00:00 2001 From: dongyukun <1208714201@qq.com> Date: 星期四, 02 一月 2025 14:19:28 +0800 Subject: [PATCH] 调度模型下发数据类型字典 --- src/utils/dateUtil.ts | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/src/utils/dateUtil.ts b/src/utils/dateUtil.ts index 658f0a1..a136ed7 100644 --- a/src/utils/dateUtil.ts +++ b/src/utils/dateUtil.ts @@ -38,3 +38,17 @@ if (second < 10) { second = '0' + second } return year + '-' + month + '-' + date + ' ' + hours + ':' + minute + ':' + second } +export function getYMDHM0 (timestamp: number | string | Date) { + const time = new Date(timestamp) + const year = time.getFullYear() + let month = time.getMonth() + 1 + '' + let date = time.getDate() + '' + let hours = time.getHours() + '' + let minute = time.getMinutes() + '' + + if (month < 10) { month = '0' + month } + if (date < 10) { date = '0' + date } + if (hours < 10) { hours = '0' + hours } + if (minute < 10) { minute = '0' + minute } + return year + '-' + month + '-' + date + ' ' + hours + ':' + minute + ':' + '00' +} -- Gitblit v1.9.3