修复秒级时间戳转格式化时间错误问题
This commit is contained in:
parent
cccfc05ea7
commit
661eed5f0a
3
time.go
3
time.go
@ -46,7 +46,6 @@ func (ot *ownTime) FormatUnixNano(timestamp int64) string {
|
|||||||
//
|
//
|
||||||
// Date : 11:55 2022/7/14
|
// Date : 11:55 2022/7/14
|
||||||
func (ot *ownTime) FormatUnixMilli(timestamp int64) string {
|
func (ot *ownTime) FormatUnixMilli(timestamp int64) string {
|
||||||
time.Now().UnixMilli()
|
|
||||||
return time.UnixMilli(timestamp).Format("2006-01-02 15:04:05.000")
|
return time.UnixMilli(timestamp).Format("2006-01-02 15:04:05.000")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,7 +55,7 @@ func (ot *ownTime) FormatUnixMilli(timestamp int64) string {
|
|||||||
//
|
//
|
||||||
// Date : 12:06 2022/7/14
|
// Date : 12:06 2022/7/14
|
||||||
func (ot *ownTime) FormatUnixSec(timestamp int64) string {
|
func (ot *ownTime) FormatUnixSec(timestamp int64) string {
|
||||||
return time.UnixMilli(timestamp).Format("2006-01-02 15:04:05")
|
return time.Unix(timestamp, 0).Format("2006-01-02 15:04:05")
|
||||||
}
|
}
|
||||||
|
|
||||||
// ParseISO8601Time 解析 2006-01-02T15:04:05+08:00 格式时间 -> 2006-01-02 15:04:05
|
// ParseISO8601Time 解析 2006-01-02T15:04:05+08:00 格式时间 -> 2006-01-02 15:04:05
|
||||||
|
Loading…
Reference in New Issue
Block a user