time包装类型增加String方法

This commit is contained in:
zhangdeman committed 2023-08-10 12:17:09 +08:00
1 parent 94c86f913f
commit b333760272
1 file changed
+9
+9
View File
@@ -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...)) 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 获取时间格式 // getTimeFormat 获取时间格式
// //
// Author : go_developer@163.com<白茶清欢> // Author : go_developer@163.com<白茶清欢>
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.