From ce3533dad7bebb53ffc730b55e08092b19ae090c Mon Sep 17 00:00:00 2001
From: dengchaochao <m18576213742@163.com>
Date: Sat, 27 Jul 2024 21:58:06 +0800
Subject: [PATCH] 7.27更改东西
---
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