Overview
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 officially used by docker as well as included by awesome-go and hello-github.
Feature
- Lightweight & zero dependency:pure
goimplementation, doesn't depend onanythird-party package,100%unit test coverage - Semantic API: provide concise and elegant chain calls with high readability, ensuring code scalability and reusability
- Powerful time manipulation:support time resolution, time addition and subtraction, time setting, time boundary, time judgment, etc
- Rich time retrieve:retrieve each parts of time (such as year, month, day, hour, minute, second, etc.) and timestamp
- Diversified output format:output time strings of different precision and formats as needed, including ISO8601, RFC series, and custom formats
- Test friendly:support setting test time, freezes current time, facilitates unit testing
- Time zone handling:support setting and obtaining time zones, as well as converting between different time zones
- I18N:support over 30 localized translation languages and allow customization of translation resources
- Error handling:provide error checking mechanism for handling errors such as time resolution
