The following is the tutorial column of golang to introduce to you the release of go-carbon1.2.5 version, which has a new carbon and time.Time mutual conversion method. I hope it will be useful to friends who need it. Helped!
go-carbon version 1.2.5 is released, with new carbon and time.Time mutual conversion methods
carbon is a lightweight, semantic, and easy-to-use tool for developers Friendly Golang time processing library, 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
// 使用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")
// Go 内置 Time.time 转 Carbon carbon.CreateFromGoTime(time.Now()) // Carbon 转 Go 内置 Time.time carbon.Now().ToGoTime()
Add a new ToGoTime() method to convert a carbon instance to time.Time
For more golang related technical articles, please visit the go language column!
The above is the detailed content of go-carbon version 1.2.5 is released, adding two new mutual conversion methods!. For more information, please follow other related articles on the PHP Chinese website!