A simple Go extension for time.Time with date manipulation, comparison, formatting, and difference calculation.
Carbon is a Go library that extends the standard time.Time package with additional functionality inspired by PHP's Carbon library. It provides a more convenient, chainable API for common date and time operations like arithmetic, comparison, and formatting while maintaining full compatibility with Go's native time package.
Go developers who need to perform frequent date and time manipulations, such as adding days or comparing dates, and want a more intuitive interface than the standard library offers.
Developers choose Carbon because it offers an intuitive, chainable API that simplifies date handling, embeds Go's time.Time for full compatibility, and includes testing utilities like time freezing, making it a practical alternative to raw time.Time operations.
Carbon for Golang, an extension for Time
Offers a fluent interface for date manipulations, making code more readable with methods like carbon.Now().AddDay() as shown in examples.
Embeds Go's time.Time, ensuring seamless interoperability with existing code and leveraging all native time package functionality.
Includes carbon.Freeze() and carbon.Now() for easy time freezing in tests, simplifying scenarios that depend on specific dates.
Facilitates working with multiple time zones, such as creating dates in 'America/Vancouver' and 'Europe/London', per the README examples.
The README explicitly notes that not all localization features from PHP's Carbon are implemented, limiting use in internationalized applications.
Admits a need to improve code style to be more idiomatic Go, which could affect maintainability and community adoption.
Introduces a third-party library where Go's standard time package might suffice, adding complexity for simple date operations.
A simple, semantic and developer-friendly time package for golang
Now is a time toolkit for golang
GoLang Parse many date strings without knowing format in advance.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.