go-carbon 2.2.6 版本发布, 轻量级、语义化、对开发者友好的Golang时间处理库

Peleus / 78 /

ChatGPT 可用网址,仅供交流学习使用,如对您有所帮助,请收藏并推荐给需要的朋友。
https://ckai.xyz

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"
更新日志
  • 修复经过json.Unmarshal解码后的时间字段时区丢失的 bug
  • 修复 DiffInYears, Age 方法计算错误的 bug
  • CreateFromStdTime 方法从 carbon.go 迁移到 creator.go
  • ToStdTime 方法从 carbon.go 迁移到 outputer.go
  • FromStdTime, Time2Carbon, Carbon2Time 等将要弃用的方法迁移到 deprecated.go
  • stretchr/testify 升级到 v1.8.4

go-carbon 2.2.6 版本发布, 轻量级、语义化、对开发者友好的Golang时间处理库
作者
Peleus
许可协议
CC BY 4.0
发布于
2023-09-07
修改于
2025-02-16
Bonnie image
尚未登录