Skip to content

Latest commit

 

History

History
500 lines (500 loc) · 30 KB

README.src.md

File metadata and controls

500 lines (500 loc) · 30 KB

carbon

[![Carbon Release](https://img.shields.io/github/release/dromara/carbon.svg)](https://github.com/dromara/carbon/releases) [![Go Test](https://github.com/dromara/carbon/actions/workflows/test.yml/badge.svg)](https://github.com/dromara/carbon/actions) [![golangci-lint](https://img.shields.io/badge/lint-golangci--lint-brightgreen?logo=go&logoColor=white&style=flat)](https://golangci-lint.run/) [![Go Coverage](https://codecov.io/gh/dromara/carbon/branch/master/graph/badge.svg)](https://codecov.io/gh/dromara/carbon) [![Carbon Doc](https://img.shields.io/badge/go.dev-reference-brightgreen?logo=go&logoColor=white&style=flat)](https://pkg.go.dev/github.com/dromara/carbon/v2) [![Awesome](https://awesome.re/badge-flat2.svg)](https://github.com/avelino/awesome-go#date-and-time) [![HelloGitHub](https://api.hellogithub.com/v1/widgets/recommend.svg?rid=0eddd8c3469549b7b246f85a83d1c42e&claim_uid=kKBvMpyxSgLhmJO&theme=small)](https://hellogithub.com/en/repository/dromara/carbon) [![License](https://img.shields.io/github/license/dromara/carbon)](https://github.com/dromara/carbon/blob/master/LICENSE) English | [简体中文](README.cn.md) | [日本語](README.ja.md) | [한국어](README.ko.md) ## Introduction `Carbon` is a lightweight, semantic, and developer-friendly `golang` time package that doesn't depend on `any` third-party package, has `100%` unit test coverage, and has been used by [docker](https://github.com/docker/docker-language-server/blob/main/go.mod#L10 "docker") organization as well as included by [awesome-go](https://github.com/yinggaozhen/awesome-go-cn#日期和时间 "awesome-go-cn") and [hello-github](https://hellogithub.com/repository/dromara/carbon "hello-github"). docker ## Repository [github.com/dromara/carbon](https://github.com/dromara/carbon "github.com/dromara/carbon") [gitee.com/dromara/carbon](https://gitee.com/dromara/carbon "gitee.com/dromara/carbon") [gitcode.com/dromara/carbon](https://gitcode.com/dromara/carbon "gitcode.com/dromara/carbon") ## Quick Start ### Installation > go version >= 1.18 ```go // Via github go get -u github.com/dromara/carbon/v2 import "github.com/dromara/carbon/v2" // Via gitee go get -u gitee.com/dromara/carbon/v2 import "gitee.com/dromara/carbon/v2" // Via gitcode go get -u gitcode.com/dromara/carbon/v2 import "gitcode.com/dromara/gitcode/v2" ``` `Carbon` was donated to the [dromara](https://dromara.org/ "dromara") organization, the repository URL has changed. If the previous repository used was `golang-module/carbon`, please replace the original repository with the new repository in `go.mod`, or execute the following command: ```go go mod edit -replace github.com/golang-module/carbon/v2 = github.com/dromara/carbon/v2 ``` ### Example Usage Default timezone is `UTC`, language locale is `English`, start day of the week is `Monday` and weekend days of the week are `Saturday` and `Sunday`. ```go carbon.SetTestNow(carbon.Parse("2020-08-05 13:14:15.999999999")) carbon.IsTestNow() // true carbon.Now().ToString() // 2020-08-05 13:14:15.999999999 +0000 UTC carbon.Yesterday().ToString() // 2020-08-04 13:14:15.999999999 +0000 UTC carbon.Tomorrow().ToString() // 2020-08-06 13:14:15.999999999 +0000 UTC carbon.Parse("2020-08-05 13:14:15").ToString() // 2020-08-05 13:14:15 +0000 UTC carbon.Parse("2022-03-08T03:01:14-07:00").ToString() // 2022-03-08 10:01:14 +0000 UTC carbon.ParseByLayout("It is 2020-08-05 13:14:15", "It is 2006-01-02 15:04:05").ToString() // 2020-08-05 13:14:15 +0000 UTC carbon.ParseByFormat("It is 2020-08-05 13:14:15", "\\I\\t \\i\\s Y-m-d H:i:s").ToString() // 2020-08-05 13:14:15 +0000 UTC carbon.CreateFromDate(2020, 8, 5).ToString() // 2020-08-05 00:00:00 +0000 UTC carbon.CreateFromTime(13, 14, 15).ToString() // 2020-08-05 13:14:15 +0000 UTC carbon.CreateFromDateTime(2020, 8, 5, 13, 14, 15).ToString() // 2020-08-05 13:14:15 +0000 UTC carbon.CreateFromTimestamp(1596633255).ToString() // 2020-08-05 13:14:15 +0000 UTC carbon.Parse("2020-07-05 13:14:15").DiffForHumans() // 1 month before carbon.Parse("2020-07-05 13:14:15").SetLocale("zh-CN").DiffForHumans() // 1 月前 carbon.ClearTestNow() carbon.IsTestNow() // false ``` For more usage examples, please refer to official document. For performance test reports, please refer to [benchmark report](docs/BENCHMARK.en.md) ## References * [briannesbitt/carbon](https://github.com/briannesbitt/Carbon) * [nodatime/nodatime](https://github.com/nodatime/nodatime) * [jinzhu/now](https://github.com/jinzhu/now) * [goframe/gtime](https://github.com/gogf/gf/tree/master/os/gtime) * [jodaOrg/joda-time](https://github.com/jodaOrg/joda-time) * [arrow-py/arrow](https://github.com/arrow-py/arrow) * [moment/moment](https://github.com/moment/moment) * [iamkun/dayjs](https://github.com/iamkun/dayjs) ## Contributors Thanks to all the following who contributed to `Carbon`: ## Translators Ask for help to translate `Carbon` in other localized languages [How to add new localized language support to carbon](https://dromara.github.io/carbon/appendix/contribution-guide.html) ## Sponsors `Carbon` is a non-commercial open source project. If you want to support `Carbon`, you can [buy a cup of coffee](https://dromara.github.io/carbon/sponsor.html) for developer. ## Thanks `Carbon` had been being developed with GoLand under the free JetBrains Open Source license, I would like to express my thanks here. JetBrains ## License `Carbon` is licensed under the `MIT` License, see the [LICENSE](./LICENSE) file for details.

carbon

[![Carbon Release](https://img.shields.io/github/release/dromara/carbon.svg)](https://github.com/dromara/carbon/releases) [![Go Test](https://github.com/dromara/carbon/actions/workflows/test.yml/badge.svg)](https://github.com/dromara/carbon/actions) [![golangci-lint](https://img.shields.io/badge/lint-golangci--lint-brightgreen?logo=go&logoColor=white&style=flat)](https://golangci-lint.run/) [![Go Coverage](https://codecov.io/gh/dromara/carbon/branch/master/graph/badge.svg)](https://codecov.io/gh/dromara/carbon) [![Carbon Doc](https://img.shields.io/badge/go.dev-reference-brightgreen?logo=go&logoColor=white&style=flat)](https://pkg.go.dev/github.com/dromara/carbon/v2) [![Awesome](https://awesome.re/badge-flat2.svg)](https://github.com/avelino/awesome-go#date-and-time) [![HelloGitHub](https://api.hellogithub.com/v1/widgets/recommend.svg?rid=0eddd8c3469549b7b246f85a83d1c42e&claim_uid=kKBvMpyxSgLhmJO&theme=small)](https://hellogithub.com/en/repository/dromara/carbon) [![License](https://img.shields.io/github/license/dromara/carbon)](https://github.com/dromara/carbon/blob/master/LICENSE) 简体中文 | [English](README.md) | [日本語](README.ja.md) | [한국어](README.ko.md) ## 项目简介 `Carbon` 是一个轻量级、语义化、对开发者友好的 `golang` 时间处理库,不依赖于 `任何` 第三方库, `100%` 单元测试覆盖率,已被 [docker](https://github.com/docker/docker-language-server/blob/main/go.mod#L10 "docker") 组织使用以及被 [awesome-go](https://github.com/yinggaozhen/awesome-go-cn#日期和时间 "awesome-go-cn") 和 [hello-github](https://hellogithub.com/repository/dromara/carbon "hello-github") 收录,并获得 `gitee` 2024 年最有价值项目(`GVP`)和 `gitcode` 2024 年度开源摘星计划 (`G-Star`) 项目 docker gvp g-star ## 仓库地址 [github.com/dromara/carbon](https://github.com/dromara/carbon "github.com/dromara/carbon") [gitee.com/dromara/carbon](https://gitee.com/dromara/carbon "gitee.com/dromara/carbon") [gitcode.com/dromara/carbon](https://gitcode.com/dromara/carbon "gitcode.com/dromara/carbon") ## 快速开始 ### 安装使用 > go version >= 1.18 ```go // 使用 github 库 go get -u github.com/dromara/carbon/v2 import "github.com/dromara/carbon/v2" // 使用 gitee 库 go get -u gitee.com/dromara/carbon/v2 import "gitee.com/dromara/carbon/v2" // 使用 gitcode 库 go get -u gitcode.com/dromara/carbon/v2 import "gitcode.com/dromara/carbon/v2" ``` `Carbon` 已经捐赠给了 [dromara](https://dromara.org/ "dromara") 开源组织,仓库地址发生了改变,如果之前用的路径是 `golang-module/carbon`,请在 `go.mod` 里将原地址更换为新路径,或执行如下命令 ```go go mod edit -replace github.com/golang-module/carbon/v2 = github.com/dromara/carbon/v2 ``` ### 用法示例 默认时区是 `UTC`, 语言环境是 `英语`,一周开始日期是 `周一`,周末是 `周六`和 `周日`。 ```go carbon.SetTestNow(carbon.Parse("2020-08-05 13:14:15.999999999")) carbon.IsTestNow() // true carbon.Now().ToString() // 2020-08-05 13:14:15.999999999 +0000 UTC carbon.Yesterday().ToString() // 2020-08-04 13:14:15.999999999 +0000 UTC carbon.Tomorrow().ToString() // 2020-08-06 13:14:15.999999999 +0000 UTC carbon.Parse("2020-08-05 13:14:15").ToString() // 2020-08-05 13:14:15 +0000 UTC carbon.Parse("2022-03-08T03:01:14-07:00").ToString() // 2022-03-08 10:01:14 +0000 UTC carbon.ParseByLayout("It is 2020-08-05 13:14:15", "It is 2006-01-02 15:04:05").ToString() // 2020-08-05 13:14:15 +0000 UTC carbon.ParseByFormat("It is 2020-08-05 13:14:15", "\\I\\t \\i\\s Y-m-d H:i:s").ToString() // 2020-08-05 13:14:15 +0000 UTC carbon.CreateFromDate(2020, 8, 5).ToString() // 2020-08-05 00:00:00 +0000 UTC carbon.CreateFromTime(13, 14, 15).ToString() // 2020-08-05 13:14:15 +0000 UTC carbon.CreateFromDateTime(2020, 8, 5, 13, 14, 15).ToString() // 2020-08-05 13:14:15 +0000 UTC carbon.CreateFromTimestamp(1596633255).ToString() // 2020-08-05 13:14:15 +0000 UTC carbon.Parse("2020-07-05 13:14:15").DiffForHumans() // 1 month before carbon.Parse("2020-07-05 13:14:15").SetLocale("zh-CN").DiffForHumans() // 1 月前 carbon.ClearTestNow() carbon.IsTestNow() // false ``` 更多用法示例请查看 官方文档,性能测试报告请查看 [分析报告](docs/BENCHMARK.cn.md) ## 参考项目 * [briannesbitt/carbon](https://github.com/briannesbitt/Carbon) * [nodatime/nodatime](https://github.com/nodatime/nodatime) * [jinzhu/now](https://github.com/jinzhu/now) * [goframe/gtime](https://github.com/gogf/gf/tree/master/os/gtime) * [jodaOrg/joda-time](https://github.com/jodaOrg/joda-time) * [arrow-py/arrow](https://github.com/arrow-py/arrow) * [moment/moment](https://github.com/moment/moment) * [iamkun/dayjs](https://github.com/iamkun/dayjs) ## 贡献者 感谢以下所有为 `Carbon` 做出贡献的人: ## 翻译者 欢迎帮助将 `Carbon` 翻译为更多本地化语言 [如何为 carbon 添加新的本地化语言支持](https://dromara.github.io/carbon/zh/appendix/contribution-guide.html) ## 赞助 `Carbon` 是一个非商业开源项目, 如果你想支持 `Carbon`, 你可以为开发者 [购买一杯咖啡](https://dromara.github.io/carbon/zh/sponsor.html) 或 点击以下赞助广告 - **Easysearch** 企业级的分布式搜索型数据库,ES 国产化的首选替代方案 Easysearch - **雨云** KVM高配版,4核 8G 300M,仅需68元/月起,半年付八折,年付七折,七天无理由退订(送5折券) [点击购买](https://www.rainyun.com/gopkg_?s=github) - **林枫云** 9950X高防,4核 8G 10M,仅需168元/月,续费同价 [点击购买](https://www.dkdun.cn/aff/NVHPHCEF) - **莱卡云** 浙江电信云,2核 4G 10M,仅需38元/月,续费同价 [点击购买](https://www.lcayun.com/aff/MBVNVNFX) ## 致谢 `Carbon`已获取免费的 JetBrains 开源许可证,在此表示感谢 JetBrains ## 开源协议 `Carbon` 遵循 `MIT` 开源协议, 请参阅 [LICENSE](./LICENSE) 查看详细信息。

carbon

[![Carbon Release](https://img.shields.io/github/release/dromara/carbon.svg)](https://github.com/dromara/carbon/releases) [![Go Test](https://github.com/dromara/carbon/actions/workflows/test.yml/badge.svg)](https://github.com/dromara/carbon/actions) [![golangci-lint](https://img.shields.io/badge/lint-golangci--lint-brightgreen?logo=go&logoColor=white&style=flat)](https://golangci-lint.run/) [![Go Coverage](https://codecov.io/gh/dromara/carbon/branch/master/graph/badge.svg)](https://codecov.io/gh/dromara/carbon) [![Carbon Doc](https://img.shields.io/badge/go.dev-reference-brightgreen?logo=go&logoColor=white&style=flat)](https://pkg.go.dev/github.com/dromara/carbon/v2) [![Awesome](https://awesome.re/badge-flat2.svg)](https://github.com/avelino/awesome-go#date-and-time) [![HelloGitHub](https://api.hellogithub.com/v1/widgets/recommend.svg?rid=0eddd8c3469549b7b246f85a83d1c42e&claim_uid=kKBvMpyxSgLhmJO&theme=small)](https://hellogithub.com/en/repository/dromara/carbon) [![License](https://img.shields.io/github/license/dromara/carbon)](https://github.com/dromara/carbon/blob/master/LICENSE) 日本語 | [English](README.md) | [简体中文](README.cn.md) | [한국어](README.ko.md) ## イントロ `Carbon` は軽量でセマンティックで開発者に優しい `golang` 時間処理ライブラリで、サードパーティ製ライブラリに依存せず、ユニットテストのカバー率は `100%` で、[docker](https://github.com/docker/docker-language-server/blob/main/go.mod#L10 "docker") に公式採用され、[awesome-go](https://github.com/yinggaozhen/awesome-go-cn#日期和时间 "awesome-go-cn") と [hello-github](https://hellogithub.com/repository/dromara/carbon "hello-github") にも収録されています。 docker ## リポジトリ [github.com/dromara/carbon](https://github.com/dromara/carbon "github.com/dromara/carbon") [gitee.com/dromara/carbon](https://gitee.com/dromara/carbon "gitee.com/dromara/carbon") [gitcode.com/dromara/carbon](https://gitcode.com/dromara/carbon "gitcode.com/dromara/carbon") ## クイックスタート ### インストール > go version >= 1.18 ```go // github から使う go get -u github.com/dromara/carbon/v2 import "github.com/dromara/carbon/v2" // gitee から使う go get -u gitee.com/dromara/carbon/v2 import "gitee.com/dromara/carbon/v2" // gitcode から使う go get -u gitcode.com/dromara/carbon/v2 import "gitcode.com/dromara/gitcode/v2" ``` `Carbon` は [dromara](https://dromara.org/ "dromara") 組織に寄付されたためリポジトリのURLが変更されました。以前のリポジトリ `golang-module/carbon` を使用している場合は`go.mod`で新しいリポジトリURLに変更するか下記コマンドを実行します ```go go mod edit -replace github.com/golang-module/carbon/v2 = github.com/dromara/carbon/v2 ``` ### 使い方と例 デフォルトのタイムゾーンは` UTC `、ロケールは`英語`、週の開始日は`月曜日`、週末は`土曜日`、`日曜日`。 ```go carbon.SetTestNow(carbon.Parse("2020-08-05 13:14:15.999999999")) carbon.IsTestNow() // true carbon.Now().ToString() // 2020-08-05 13:14:15.999999999 +0000 UTC carbon.Yesterday().ToString() // 2020-08-04 13:14:15.999999999 +0000 UTC carbon.Tomorrow().ToString() // 2020-08-06 13:14:15.999999999 +0000 UTC carbon.Parse("2020-08-05 13:14:15").ToString() // 2020-08-05 13:14:15 +0000 UTC carbon.Parse("2022-03-08T03:01:14-07:00").ToString() // 2022-03-08 10:01:14 +0000 UTC carbon.ParseByLayout("It is 2020-08-05 13:14:15", "It is 2006-01-02 15:04:05").ToString() // 2020-08-05 13:14:15 +0000 UTC carbon.ParseByFormat("It is 2020-08-05 13:14:15", "\\I\\t \\i\\s Y-m-d H:i:s").ToString() // 2020-08-05 13:14:15 +0000 UTC carbon.CreateFromDate(2020, 8, 5).ToString() // 2020-08-05 00:00:00 +0000 UTC carbon.CreateFromTime(13, 14, 15).ToString() // 2020-08-05 13:14:15 +0000 UTC carbon.CreateFromDateTime(2020, 8, 5, 13, 14, 15).ToString() // 2020-08-05 13:14:15 +0000 UTC carbon.CreateFromTimestamp(1596633255).ToString() // 2020-08-05 13:14:15 +0000 UTC carbon.Parse("2020-07-05 13:14:15").DiffForHumans() // 1 month before carbon.Parse("2020-07-05 13:14:15").SetLocale("zh-CN").DiffForHumans() // 1 月前 carbon.ClearTestNow() carbon.IsTestNow() // false ``` より多くの使用例については、公式ドキュメントをご覧ください。 性能テストレポートについては、[ベンチマークレポート](docs/BENCHMARK.ja.md)をご参照ください ## リファレンス * [briannesbitt/carbon](https://github.com/briannesbitt/Carbon) * [nodatime/nodatime](https://github.com/nodatime/nodatime) * [jinzhu/now](https://github.com/jinzhu/now) * [goframe/gtime](https://github.com/gogf/gf/tree/master/os/gtime) * [jodaOrg/joda-time](https://github.com/jodaOrg/joda-time) * [arrow-py/arrow](https://github.com/arrow-py/arrow) * [moment/moment](https://github.com/moment/moment) * [iamkun/dayjs](https://github.com/iamkun/dayjs) ## コントリビューター `Carbon` に貢献してくれた以下のすべてに感謝します: ## 翻訳者 `Carbon` を他のローカライズ言語に翻訳してくださる方を募集しています [Carbon に新しいローカライズ言語サポートを追加する方法](https://dromara.github.io/carbon/ja/appendix/contribution-guide.html) ## スポンサー `Carbon` は非営利のオープンソースプロジェクトです,`Carbon` をサポートしたい場合は、開発者のために [コーヒーを1杯購入](https://dromara.github.io/carbon/ja/sponsor.html) できます ## 謝辞 `Carbon` は無料の JetBrains オープンソースライセンスを取得しました,これに感謝します JetBrains ## オープンソースプロトコル `Carbon` は `MIT` オープンソースプロトコルに準拠しており、詳細は [LICENSE](./LICENSE) を参照してください

carbon

[![Carbon Release](https://img.shields.io/github/release/dromara/carbon.svg)](https://github.com/dromara/carbon/releases) [![Go Test](https://github.com/dromara/carbon/actions/workflows/test.yml/badge.svg)](https://github.com/dromara/carbon/actions) [![golangci-lint](https://img.shields.io/badge/lint-golangci--lint-brightgreen?logo=go&logoColor=white&style=flat)](https://golangci-lint.run/) [![Go Coverage](https://codecov.io/gh/dromara/carbon/branch/master/graph/badge.svg)](https://codecov.io/gh/dromara/carbon) [![Carbon Doc](https://img.shields.io/badge/go.dev-reference-brightgreen?logo=go&logoColor=white&style=flat)](https://pkg.go.dev/github.com/dromara/carbon/v2) [![Awesome](https://awesome.re/badge-flat2.svg)](https://github.com/avelino/awesome-go#date-and-time) [![HelloGitHub](https://api.hellogithub.com/v1/widgets/recommend.svg?rid=0eddd8c3469549b7b246f85a83d1c42e&claim_uid=kKBvMpyxSgLhmJO&theme=small)](https://hellogithub.com/en/repository/dromara/carbon) [![License](https://img.shields.io/github/license/dromara/carbon)](https://github.com/dromara/carbon/blob/master/LICENSE) 한국어 | [English](README.md) | [简体中文](README.cn.md) | [日本語](README.ja.md) ## 소개 `Carbon` 은 가벼우면서도 의미론적이고 개발자 친화적인 `golang` 시간 처리 라이브러리로, `어떤` 서드파티 라이브러리에도 의존하지 않으며, `100%` 단위 테스트 커버리지를 가지고 있으며, [docker](https://github.com/docker/docker-language-server/blob/main/go.mod#L10 "docker")에 공식적으로 사용되고 있고 [awesome-go](https://github.com/yinggaozhen/awesome-go-cn#日期和时间 "awesome-go-cn") 와 [hello-github](https://hellogithub.com/repository/dromara/carbon "hello-github")에도 수록되어 있습니다. docker ## 저장소 [github.com/dromara/carbon](https://github.com/dromara/carbon "github.com/dromara/carbon") [gitee.com/dromara/carbon](https://gitee.com/dromara/carbon "gitee.com/dromara/carbon") [gitcode.com/dromara/carbon](https://gitcode.com/dromara/carbon "gitcode.com/dromara/carbon") ## 빠른 시작 ### 설치 > go version >= 1.18 ```go // GitHub를 통해 go get -u github.com/dromara/carbon/v2 import "github.com/dromara/carbon/v2" // Gitee를 통해 go get -u gitee.com/dromara/carbon/v2 import "gitee.com/dromara/carbon/v2" // GitCode를 통해 go get -u gitcode.com/dromara/carbon/v2 import "gitcode.com/dromara/gitcode/v2" ``` `Carbon`은 [dromara](https://dromara.org/ "dromara") 조직에 기부되었으며, 저장소 URL이 변경되었습니다. 이전에 사용하던 저장소가 `golang-module/carbon`이었다면, `go.mod`에서 원래 저장소를 새 저장소로 교체하거나 다음 명령을 실행하세요: ```go go mod edit -replace github.com/golang-module/carbon/v2 = github.com/dromara/carbon/v2 ``` ### 사용 예시 기본 시간대는 `UTC`이고, 언어 로케일은 `English`이며, 주의 시작일은 `Monday`이고 주말은 `Saturday`와 `Sunday`입니다. ```go carbon.SetTestNow(carbon.Parse("2020-08-05 13:14:15.999999999")) carbon.IsTestNow() // true carbon.Now().ToString() // 2020-08-05 13:14:15.999999999 +0000 UTC carbon.Yesterday().ToString() // 2020-08-04 13:14:15.999999999 +0000 UTC carbon.Tomorrow().ToString() // 2020-08-06 13:14:15.999999999 +0000 UTC carbon.Parse("2020-08-05 13:14:15").ToString() // 2020-08-05 13:14:15 +0000 UTC carbon.Parse("2022-03-08T03:01:14-07:00").ToString() // 2022-03-08 10:01:14 +0000 UTC carbon.ParseByLayout("It is 2020-08-05 13:14:15", "It is 2006-01-02 15:04:05").ToString() // 2020-08-05 13:14:15 +0000 UTC carbon.ParseByFormat("It is 2020-08-05 13:14:15", "\\I\\t \\i\\s Y-m-d H:i:s").ToString() // 2020-08-05 13:14:15 +0000 UTC carbon.CreateFromDate(2020, 8, 5).ToString() // 2020-08-05 00:00:00 +0000 UTC carbon.CreateFromTime(13, 14, 15).ToString() // 2020-08-05 13:14:15 +0000 UTC carbon.CreateFromDateTime(2020, 8, 5, 13, 14, 15).ToString() // 2020-08-05 13:14:15 +0000 UTC carbon.CreateFromTimestamp(1596633255).ToString() // 2020-08-05 13:14:15 +0000 UTC carbon.Parse("2020-07-05 13:14:15").DiffForHumans() // 1 month before carbon.Parse("2020-07-05 13:14:15").SetLocale("zh-CN").DiffForHumans() // 1 月前 carbon.ClearTestNow() carbon.IsTestNow() // false ``` 더 많은 사용 예시는 공식 문서를 참조하세요. 성능 테스트 보고서는 [벤치마크 보고서](docs/BENCHMARK.ko.md)를 참조하세요. ## 참고 자료 * [briannesbitt/carbon](https://github.com/briannesbitt/Carbon) * [nodatime/nodatime](https://github.com/nodatime/nodatime) * [jinzhu/now](https://github.com/jinzhu/now) * [goframe/gtime](https://github.com/gogf/gf/tree/master/os/gtime) * [jodaOrg/joda-time](https://github.com/jodaOrg/joda-time) * [arrow-py/arrow](https://github.com/arrow-py/arrow) * [moment/moment](https://github.com/moment/moment) * [iamkun/dayjs](https://github.com/iamkun/dayjs) ## 기여자 `Carbon`에 기여한 모든 분들께 감사드립니다: ## 번역자 `Carbon` 을 더 많은 로컬라이즈드 언어로 번역하는 데 도움을 요청드립니다 [Carbon에 새로운 로컬라이즈드 언어 지원을 추가하는 방법](https://dromara.github.io/carbon/ko/appendix/contribution-guide.html) ## 스폰서 `Carbon`은 비상업적 오픈소스 프로젝트입니다. `Carbon`을 지원하고 싶으시다면 개발자에게 [커피 한 잔을 사주세요](https://dromara.github.io/carbon/ko/sponsor.html). ## 감사의 말 `Carbon`은 JetBrains 오픈소스 라이선스의 무료 GoLand로 개발되었습니다. 여기서 감사의 말을 전하고 싶습니다. JetBrains ## 라이선스 `Carbon`은 `MIT` 라이선스 하에 제공됩니다. 자세한 내용은 [LICENSE](./LICENSE) 파일을 참조하세요.