1
This commit is contained in:
parent
f913e480a2
commit
d72fab5c83
12
sysutils.go
12
sysutils.go
@ -116,18 +116,18 @@ func IsNumberType(v interface{}) bool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func FormatUnixDateTime(sec int64) string {
|
func FormatUnixDateTime(sec int64, loc *time.Location) string {
|
||||||
strTime := time.Unix(sec, 0).Format("2006-01-02 15:04:05")
|
strTime := time.Unix(sec, 0).In(loc). Format("2006-01-02 15:04:05")
|
||||||
return strTime
|
return strTime
|
||||||
}
|
}
|
||||||
|
|
||||||
func FormatUnixDate(sec int64) string {
|
func FormatUnixDate(sec int64, loc *time.Location) string {
|
||||||
strTime := time.Unix(sec, 0).Format("2006-01-02")
|
strTime := time.Unix(sec, 0).In(loc).Format("2006-01-02")
|
||||||
return strTime
|
return strTime
|
||||||
}
|
}
|
||||||
|
|
||||||
func FormatUnixDateEx(sec int64) string {
|
func FormatUnixDateEx(sec int64, loc *time.Location) string {
|
||||||
strTime := time.Unix(sec, 0).Format("20060102")
|
strTime := time.Unix(sec, 0).In(loc).Format("20060102")
|
||||||
return strTime
|
return strTime
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user