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

187 天前
 gouguoyin

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"
更新日志
1546 次点击
所在节点    Go 编程语言
28 条回复
Rache1
187 天前
@sakuramanstein #9 目测是 PHP 转 GO 的,Carbon 在 PHP 这边是一个很知名的包。

大致看了一下 API ,几乎都一样了。

原包下面提到来自:

Radiocarbon dating - Wikipedia
https://en.wikipedia.org/wiki/Radiocarbon_dating?useskin=vector
ruooooooli
187 天前
@CEBBCAT #19


go get -u github.com/golang-module/carbon/v2
cannot find package "github.com/golang-module/carbon/v2" in any of:
/opt/homebrew/Cellar/go@1.18/1.18.10/libexec/src/github.com/golang-module/carbon/v2 (from $GOROOT)
/Users/zk/Work/code/go/src/github.com/golang-module/carbon/v2 (from $GOPATH)

难道是要开启 gomodule 么
gouguoyin
187 天前
@CEBBCAT 不同地址就是不同的包,但是 api 都一样,gitee 只是为了方便国内用户使用。
gouguoyin
187 天前
@ruooooooli 必须开启 go module
ruooooooli
187 天前
@gouguoyin #24 😄好的我试下
gouguoyin
187 天前
@ruooooooli go 从 1.11 后就开始使用 module 作为唯一包管理工具
CEBBCAT
187 天前
@gouguoyin #23 明白
gouguoyin
159 天前
@RedisMasterNode v2.3.1 已加上 benchmark

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/996717

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX