From 4e517dc54e1e3e5e5b543383c321161de351272e Mon Sep 17 00:00:00 2001
From: yangan <yangan0921@163.com>
Date: 星期一, 11 十一月 2024 16:05:06 +0800
Subject: [PATCH] Merge branch 'feature/jlhg/first' of http://39.96.92.240:10000/r/~fyy/unattended-app into feature/jlhg/first

---
 utils/util.js |   23 +++++++++++++++--------
 1 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/utils/util.js b/utils/util.js
index f9b67d7..23af966 100644
--- a/utils/util.js
+++ b/utils/util.js
@@ -1,4 +1,4 @@
-export function todayDate(arg){
+export function todayDate(arg) {
 	let date = new Date()
 	let year = date.getFullYear()
 	let month = date.getMonth() + 1;
@@ -6,11 +6,18 @@
 	let hour = date.getHours()
 	let minutes = date.getMinutes()
 	let seconds = date.getSeconds()
-	console.log(arg,'鏃堕棿');
-	if(arg == 'hms'){
-		hour = hour < 10 ? '0' + hour : hour
-		minutes = minutes < 10 ? '0' + minutes : minutes
-		seconds = seconds < 10 ? '0' + seconds : seconds
-		return hour+':'+minutes+':' + seconds
+	hour = hour < 10 ? '0' + hour : hour
+	minutes = minutes < 10 ? '0' + minutes : minutes
+	seconds = seconds < 10 ? '0' + seconds : seconds
+	month = month < 10 ? '0' + month : month
+	day = day < 10 ? '0' + day : day
+	if (arg == 'hms') {
+		return hour + ':' + minutes + ':' + seconds
+	}else if(arg == 'ymd') {
+		return year + '-' + month + '-' + day
+	}if (arg == 'ymd hm') {
+		return year + '-' + month + '-' + day + ' ' + hour + ':' + minutes
+	}else {
+		return year + '-' + month + '-' + day + ' ' + hour + ':' + minutes + ':' + seconds
 	}
-}
\ No newline at end of file
+}

--
Gitblit v1.9.1