opt time
This commit is contained in:
parent
e3360c3bfd
commit
2643c72c28
3
time.go
3
time.go
|
@ -13,6 +13,9 @@ func TimeToDate(t int64) string {
|
||||||
|
|
||||||
// 时间戳转为datetime格式
|
// 时间戳转为datetime格式
|
||||||
func TimeToDateTime(t int64) string {
|
func TimeToDateTime(t int64) string {
|
||||||
|
if t == 0 {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
tm := time.Unix(t, 0)
|
tm := time.Unix(t, 0)
|
||||||
return tm.Format("2006-01-02 15:04:05")
|
return tm.Format("2006-01-02 15:04:05")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue