From eeaf205ba491500a43b1a0fd2a4ed4d283b8b4ac Mon Sep 17 00:00:00 2001 From: PandaX-Go Date: Tue, 20 Aug 2024 20:15:25 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BC=98=E5=8C=96]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/tool/conv.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/tool/conv.go b/pkg/tool/conv.go index 16915e8..f428680 100644 --- a/pkg/tool/conv.go +++ b/pkg/tool/conv.go @@ -142,6 +142,11 @@ func TimeToFormat(val interface{}) string { // 格式化时间字符串 formattedTime := t.Format("2006-01-02 15:04:05") return formattedTime + case float64: + t := timestampToTime(int64(v)) + // 格式化时间字符串 + formattedTime := t.Format("2006-01-02 15:04:05") + return formattedTime case string: // 如果是字符串类型,将其解析为时间对象 t, err := time.Parse("2006-01-02 15:04:05", v)