The following column golang tutorial will introduce to you about the go-carbon 1.2.4 version release, a new series of time comparison methods, I hope it will be helpful to friends who need it help!
![go-carbon1.2.4 is released! Added series time comparison method](https://img.php.cn/upload/article/000/000/020/5fa4f4927686f404.jpg)
carbon is a lightweight, semantic, developer-friendly Golang time processing library that supports chain calls, lunar calendar and mainstream ORMs such as gorm and xorm
If you think it is good, please give it a star
github:github.com/golang-module/carbon
gitee:gitee.com/go-package/carbon
Copy after login
Installation and use
// 使用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")
Copy after login
Update log
- Deprecate the Duration() method and split it For 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
- New Eq() method to determine whether it is equal
- New Ne() method to determine whether it is not equal
- New Gte() method to determine whether it is greater than or equal
- Added Lte() method to determine whether it is less than or equal to
- Added Between() method to determine whether it is between two times (excluding these two times)
- New 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 the end time)
- New Added BetweenIncludedBoth() method to determine whether it is between two times (including these two times)
The above is the detailed content of go-carbon1.2.4 is released! Added series time comparison method. For more information, please follow other related articles on the PHP Chinese website!