This commit is contained in:
jiangyong27 2023-06-02 12:08:14 +08:00
parent e3360c3bfd
commit 2643c72c28
1 changed files with 3 additions and 0 deletions

View File

@ -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")
} }