From 30e3526b109a94b83ee53d460b5626300361e5a5 Mon Sep 17 00:00:00 2001
From: wk
Date: 星期二, 18 六月 2024 09:48:40 +0800
Subject: [PATCH] feat:司机人脸更改

---
 utils/util.js |   20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/utils/util.js b/utils/util.js
index f5e9768..7d227a6 100644
--- a/utils/util.js
+++ b/utils/util.js
@@ -1,7 +1,21 @@
-export function todayDate(){
+export function todayDate(arg) {
 	let date = new Date()
 	let year = date.getFullYear()
 	let month = date.getMonth() + 1;
 	let day = date.getDate()
-	return year + '-' + month + '-' + day
-}
\ No newline at end of file
+	let hour = date.getHours()
+	let minutes = date.getMinutes()
+	let seconds = date.getSeconds()
+	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
+	}else {
+		return year + '-' + month + '-' + day + ' ' + hour + ':' + minutes + ':' + seconds
+	}
+}

--
Gitblit v1.9.1