支持将 time.Time(time.Now())格式的数据编码转换标准显示格式
支持将 整形时间戳(1603758504)的数据编码转换标准显示格式
源码地址
命令行安装:
go get https://github.com/go-creed/common
测试用例地址
https://github.com/go-creed/common/tree/main/jtime
Jtime
jtime.Init
models:
type Int struct {
CreatedAt jtime.Int `gorm:"comment:'创建时间';type:bigint not null;" json:"created_at"`
Id int `json:"id"`
}
data:
[{1603765784 1} {1603765900 4} {1603765907 5} {1603765933 6} {1603767542 7}]
show:
[{"created_at":"2020-10-27 10:29:44","id":1},{"created_at":"2020-10-27 10:31:40","id":4},{"cre