From d72fab5c8332d0164d9b3af5fc63257adb597dda Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sat, 9 Sep 2023 10:51:49 +0800 Subject: [PATCH] 1 --- sysutils.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sysutils.go b/sysutils.go index 66e21ea..dd80424 100644 --- a/sysutils.go +++ b/sysutils.go @@ -116,18 +116,18 @@ func IsNumberType(v interface{}) bool { } } -func FormatUnixDateTime(sec int64) string { - strTime := time.Unix(sec, 0).Format("2006-01-02 15:04:05") +func FormatUnixDateTime(sec int64, loc *time.Location) string { + strTime := time.Unix(sec, 0).In(loc). Format("2006-01-02 15:04:05") return strTime } -func FormatUnixDate(sec int64) string { - strTime := time.Unix(sec, 0).Format("2006-01-02") +func FormatUnixDate(sec int64, loc *time.Location) string { + strTime := time.Unix(sec, 0).In(loc).Format("2006-01-02") return strTime } -func FormatUnixDateEx(sec int64) string { - strTime := time.Unix(sec, 0).Format("20060102") +func FormatUnixDateEx(sec int64, loc *time.Location) string { + strTime := time.Unix(sec, 0).In(loc).Format("20060102") return strTime }