From e16d0e082e8f951bfba3f85ae459144c9f59b4f9 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期一, 04 九月 2023 15:41:21 +0800
Subject: [PATCH] 1.0.4
---
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