From de25112d4020ccb216fcd9e99ec8d3e145c978b3 Mon Sep 17 00:00:00 2001
From: dcc <dcc@163.com>
Date: Mon, 22 Jul 2024 16:37:04 +0800
Subject: [PATCH] 7.22更改
---
src/utils/utils.js | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/src/utils/utils.js b/src/utils/utils.js
index 3fc155d..2e61c45 100644
--- a/src/utils/utils.js
+++ b/src/utils/utils.js
@@ -44,3 +44,10 @@
}
};
+export const initDate = (originalTimeStr) => {
+ const now = new Date(); // 创建一个当前日期时间的实例,这里只使用日期部分不影响时间部分
+ const timeParts = originalTimeStr.split(':'); // 将时间字符串拆分为时、分、秒
+ now.setHours(timeParts[0], timeParts[1], timeParts[2]); // 设置日期时间的小时、分钟、秒,但不改变日期
+ return now.toLocaleTimeString('en-US');
+};
+
--
Gitblit v1.9.3