time包装类型增加String方法
This commit is contained in:
parent
94c86f913f
commit
b333760272
9
time.go
9
time.go
@ -135,6 +135,15 @@ func (t *Time) FormatUnixSec(layout ...string) string {
|
||||
return time.Unix(t.Unix(), 0).In(time.Local).Format(t.getTimeFormat(StandTimeFormat, layout...))
|
||||
}
|
||||
|
||||
// String 转字符串
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 12:16 2023/8/10
|
||||
func (t *Time) String(layout ...string) string {
|
||||
return t.FormatUnixSec(layout...)
|
||||
}
|
||||
|
||||
// getTimeFormat 获取时间格式
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
|
Loading…
Reference in New Issue
Block a user