Closed shuqingzai closed 9 months ago
Upgrade to v2.3.9, using DiffInDuration
or DiffAbsInDuration
method, such as
now := carbon.Now()
now.DiffInDuration(now).String() // 0s
now.AddHour().DiffInDuration(now).String() // 1h0m0s
now.SubHour().DiffInDuration(now).String() // -1h0m0s
pkg version:
github.com/golang-module/carbon/v2 v2.2.14
目前似乎无法直接比较获取
time.Duration
,只能解析标准库获取??示例代码