carbon 是一个轻量级、语义化、对开发者友好的 Golang 时间处理库,提供了对时间穿越、时间差值、时间极值、时间判断、星座、星座、农历、儒略日 / 简化儒略日、波斯历 / 伊朗历的支持。

gitee地址:https://gitee.com/dromara/carbon

carbon 目前已捐赠给 dromara 开源组织,已被  awesome-go 收录,并获得 gitee 2024 年最有价值项目(GVP)和 gitcode 2024 年度 G-Star项目,如果您觉得不错,请给个 star 吧

github.com/dromara/carbon

gitee.com/dromara/carbon

gitcode.com/dromara/carbon

更新日志

  • 仓库地址从 github.com/golang-module/carbon 改成 github.com/dromara/carbon
  • 增加对 匈牙利 的翻译支持,由 @kenlas 翻译
  • 重新翻译 日文版 README 文件,由日本友人 @You-saku 翻译
  • 修复 DiffInMonths() 计算错误的 bug
  • Lock()Unlock() 替换成  RLock()URnlock()
  • 删除 ToDateTimeStruct()ToDateTimeMilliStruct()ToDateTimeMicroStruct()ToDateStruct()等方法,由新增的 NewDateTime()NewDateTimeMilli()NewDateTimeMicro()、NewDate() 等方法替换
  • DateTimeDateTimeXXXDateDateXXXTimeTimeXXX 等结构体实现  ScanValueMarshalJSONUnmarshalJSON 接口
  • Scan 接口实现时支持对 string[]byteTime.time 格式的解析支持
  • UnmarshalJSON 解析 json 格式时间字符串时,统一使用全局默认时区 defaultTimezon
  • codecov/codecov-actionv4 升级到 v5
参考资料
[1]

dromara: https://dromara.org/

[2]

awesome-go: https://github.com/avelino/awesome-go#date-and-time

[3]

gitee: https://gitee.com

[4]

GVP: https://gitee.com/gcp

[5]

gitcode: https://gitcode.com

[6]

G-Star: https://gitcode.com/g-star

[7]

https://github.com/dromara/carbon