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 }