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

gouguoyin · 23天之前 · 170 次点击 · 大约8小时之前 开始浏览    置顶

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

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

github.com/dromara/carbon

gitee.com/dromara/carbon

gitcode.com/dromara/carbon

中文
  • CreateFromLunar, CreateFromPersian 方法去掉 hour, minute, second 参数
  • 更改部分格式符号定义,涉及到的符号有 U, V, X,S,T Z,u,v,x,z
  • 修复农历中 IsLeapMonth 判断错误的 bug
  • 修复 AtomFormatAtomLayout 格式返回值不一致的 bug
  • 修复 RFC3339FormatRFC3339Layout 格式返回值不一致的 bug
  • 设置全局默认时区时不再同步更新 time.Local
  • 新增格式符号o 来获取时区偏移量
  • 新增 TimestampLayoutTimestampMilliLayoutTimestampMicroLayoutTimestampNanoLayout 常量
  • 新增 TimestampFormatTimestampMilliFormatTimestampMicroFormatTimestampNanoFormat 常量
  • 新增 DateTimeMilliDateTimeMicroDateTimeNano 字段类型
  • 新增 DateMilliDateMicroDateNano 字段类型
  • 新增 TimeMilliTimeMicroTimeNano 字段类型
English
  • Remove hour, Minute,second parameter in CreateFromLunar,CreateFromPersian methods
  • Change some format symbol definitions involves symbols such as U, V, X,S,T Z,u,v,x,z
  • Fix bug of incorrect judgment of IsLeapMonth in lunar calendar
  • Fix bug of AtomFormat and AtomLayout return inconsistent value
  • Fix bug of RFC3339Format and RFC3339Layout return inconsistent value
  • time.Local is not updated when setting global time zone
  • Add format symbol o to get time zone offset
  • Add TimestampLayout, TimestampMilliLayout, TimestampMicroLayout and TimestampNanoLayout constants
  • Add TimestampFormat, TimestampMilliFormat, TimestampMicroFormat and TimestampNanoFormat constants
  • Add DateTimeMilli, DateTimeMicro, DateTimeNano field types
  • Add DateMilliDateMicroDateNano field types
  • Add TimeMilliTimeMicroTimeNano field types

有疑问加站长微信联系(非本文作者)

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

170 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传