A lightweight, semantic, and developer-friendly Go package for date and time manipulation without third-party dependencies.
Carbon is a Go package for date and time manipulation that provides a semantic and developer-friendly API. It solves the complexity of Go's native time handling by offering intuitive methods for parsing, formatting, and calculating dates without external dependencies.
Go developers who need robust and easy-to-use date/time functionality in their applications, especially those working on internationalized projects or requiring reliable time operations.
Developers choose Carbon for its clean API, lack of dependencies, and comprehensive feature set—including localization and testing utilities—which streamline date/time handling compared to Go's standard library.
A simple, semantic and developer-friendly time package for golang
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Offers intuitive methods like DiffForHumans() and flexible parsing options, reducing the boilerplate code common in Go's stdlib time handling.
Built entirely in Go without external packages, ensuring easy installation and no version conflicts, as highlighted in the README.
Maintains 100% unit test coverage, providing high reliability and confidence in date/time operations.
Includes localization for multiple languages through SetLocale(), allowing easy formatting for different locales as shown in examples.
Provides functions like SetTestNow() to simplify unit testing by mocking time, making tests deterministic and easier to write.
Recent transition from golang-module/carbon to dromara/carbon requires manual updates in go.mod, which can break existing projects if not handled carefully.
Abstraction over Go's stdlib time package may introduce slight overhead for very high-frequency operations compared to direct stdlib use, despite benchmark reports.
Requires Go 1.18 or higher, excluding projects stuck on older Go versions due to compatibility constraints.