Skip to content

Commit

Permalink
添加创建时间字段
Browse files Browse the repository at this point in the history
  • Loading branch information
steden committed Dec 29, 2023
1 parent bce9e75 commit ef6dcb3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dateTime/dt.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ func NewUnixMilli(msec int64) DateTime {
}
}

// NewUnixMicro 初始化
func NewUnixMicro(usec int64) DateTime {
return DateTime{
time: time.UnixMicro(usec),
}
}

// Since time.Now().Sub(dt).
func Since(dt DateTime) time.Duration {
return time.Since(dt.ToTime())
Expand Down

0 comments on commit ef6dcb3

Please sign in to comment.