Home > Article > Backend Development > [Go-carbon version 1.1.1 released] Improve support for mainstream ORM and add public methods
The following is introduced by the golang tutorial column [Go-carbon1.1.1 version released] improves support for mainstream ORM, adds public methods, and hopes to Friends in need help!
carbon is a lightweight, semantic, IDE-friendly date and time processing library. It is the Golang implementation version of the PHP Carbon library. The original intention is to get rid of Golang's anti-humanity 2006-01-02 15:04 :05 Format time design, support chain calls and mainstream ORMs such as gorm and xrom
If you think it is good, please give it a star
github:https://github.com/golang-module/carbon gitee:ghttps://gitee.com/go-package/carbon
go get -u gitee.com/go-package/carbon
import ( "gitee.com/go-package/carbon")// 初始化,默认时区为Local,即服务器所在时区c := carbon.New()// 初始化并设置时区c := carbon.New().Timezone(carbon.PRC)
For more time zone constants, please view the const.go (https://gitee.com/go-package/carbon/blob/master/const.go) file
The above is the detailed content of [Go-carbon version 1.1.1 released] Improve support for mainstream ORM and add public methods. For more information, please follow other related articles on the PHP Chinese website!