The Go Programming Language
› http://golang.org/
› Go Playground
Go Projects
› Revel Web Framework
gouguoyin

go-carbon v2.3.11 发布,轻量级、语义化、对开发者友好的 golang 时间处理库

  •  
  •   gouguoyin ·
    kuafuRace · Apr 10, 2024 · 2085 views
    This topic created in 937 days ago, the information mentioned may be changed or developed.

    carbon 是一个轻量级、语义化、对开发者友好的 golang 时间处理库,支持链式调用。

    目前已被 awesome-go 收录,如果您觉得不错,请给个 star 吧

    github.com/golang-module/carbon

    gitee.com/golang-module/carbon

    安装使用

    Golang 版本大于等于 1.16
    // 使用 github 库
    go get -u github.com/golang-module/carbon/v2
    
    import "github.com/golang-module/carbon/v2"
    
    // 使用 gitee 库
    go get -u gitee.com/golang-module/carbon/v2
    
    import "gitee.com/golang-module/carbon/v2"
    
    Golang 版本小于 1.16
    // 使用 github 库
    go get -u github.com/golang-module/carbon
    
    import "github.com/golang-module/carbon"
    
    // 使用 gitee 库
    go get -u gitee.com/golang-module/carbon
    
    import  "gitee.com/golang-module/carbon"
    

    更新日志

    • Parse 方法增加对 2006-01-02 15:04:05-0700 MST 格式字符串的解析支持
    • Parse 方法解析零值时间 0001-01-01 00:00:00 时返回原始值而不是返回空
    • IsValid、IsInvalid 方法优化判断逻辑
    • DiffAbsInDuration 方法自行实现 Abs 方法,而不必将 go 升级到 1.9+
    • 统一单元测试格式
    3 replies  •  2024-04-10 14:12:59 +08:00
    jorneyr
    jorneyr
    Apr 10, 2024
    1
    库的名字没有一个单词和时间有关。
    gouguoyin
    gouguoyin
    OP
    Apr 10, 2024
    2
    @jorneyr prometheus 和 监控有什么关系么? apple 和手机有什么关系么?
    maemo
    maemo
    Apr 10, 2024
    3
    用过 php 的应该知道 carbon
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4982 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 43ms · UTC 01:38 · PVG 09:38 · LAX 17:38 · JFK 20:38
    ♥ Do have faith in what you're doing.