From 682182cf67a5aa9fed34335fea22d4673f30f10c Mon Sep 17 00:00:00 2001
From: Mr.Shi <1878285526@qq.com>
Date: 星期一, 04 九月 2023 11:59:44 +0800
Subject: [PATCH] 小程序
---
minipro_standard/util/utils.js | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/minipro_standard/util/utils.js b/minipro_standard/util/utils.js
index dd64b20..76809d9 100644
--- a/minipro_standard/util/utils.js
+++ b/minipro_standard/util/utils.js
@@ -12,4 +12,19 @@
return y + '-' + m + '-' + d;
}
-export { gsdate }
+/***
+ *
+ * @param time 鏃ユ湡 骞存湀鏃ユ椂鍒嗙
+ * @param Sign 闂撮殧
+ */
+function setTime (time, Sign) {
+ let year = time.getFullYear();
+ let month = time.getMonth() + 1 >= 10 ? time.getMonth() + 1 : `0${time.getMonth() + 1}`;
+ let day = time.getDate() >= 10 ? time.getDate() : `0${time.getDate()}`;
+ let hour = time.getHours() >= 10 ? time.getHours() : `0${time.getHours()}`;
+ let minute = time.getMinutes() >= 10 ? time.getMinutes() : `0${time.getMinutes()}`;
+ let second = time.getSeconds() >= 10 ? time.getSeconds() : `0${time.getSeconds()}`;
+ return [year, Sign, month , Sign, day, ' ', hour , ':', minute, ':', second ].join('');
+}
+
+export { gsdate, setTime }
--
Gitblit v1.9.3