From 661eed5f0af8649561c4a1cc69da7837be78de8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Sun, 12 Feb 2023 00:06:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=A7=92=E7=BA=A7=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E6=88=B3=E8=BD=AC=E6=A0=BC=E5=BC=8F=E5=8C=96=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- time.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/time.go b/time.go index 69741bc..d57abb0 100644 --- a/time.go +++ b/time.go @@ -46,7 +46,6 @@ func (ot *ownTime) FormatUnixNano(timestamp int64) string { // // Date : 11:55 2022/7/14 func (ot *ownTime) FormatUnixMilli(timestamp int64) string { - time.Now().UnixMilli() return time.UnixMilli(timestamp).Format("2006-01-02 15:04:05.000") } @@ -56,7 +55,7 @@ func (ot *ownTime) FormatUnixMilli(timestamp int64) string { // // Date : 12:06 2022/7/14 func (ot *ownTime) FormatUnixSec(timestamp int64) string { - return time.UnixMilli(timestamp).Format("2006-01-02 15:04:05") + return time.Unix(timestamp, 0).Format("2006-01-02 15:04:05") } // ParseISO8601Time 解析 2006-01-02T15:04:05+08:00 格式时间 -> 2006-01-02 15:04:05