carbon is a lightweight, semantic, and developer-friendly Golang time processing library that supports chain calls, lunar calendar, gorm, xorm and other mainstream orm
If you think it's good, please give a star
github: github.com/golang-module/carbon
gitee: gitee.com/go-package/carbon
// 使用github库
go get -u github.com/golang-module/carbon
import (
"github.com/golang-module/carbon"
)
// 使用gitee库
go get -u gitee.com/go-package/carbon
import (
"gitee.com/go-package/carbon"
)
Update log
- Deprecated Duration() method, split into AddDuration() and SubDuration()
- Added Compare() method to compare time
- Added Gt() method to determine whether it is greater than
- Added Lt() method to determine whether it is less than
- Added Eq() method to determine whether it is equal to
- Added Ne() method to determine whether it is not equal to
- Added Gte() method to determine whether it is greater than or equal to
- Added Lte() method to determine whether it is less than or equal to
- Added Between() method to determine whether it is between two times (not including these two times)
- Added BetweenIncludedStartTime() method to determine whether it is between two times (including the start time)
- Added BetweenIncludedEndTime() method to determine whether it is between two times (including end time)
- Added BetweenIncludedBoth() method to determine whether it is between two times (including these two times)