A library for handling dates and times across arbitrary calendar systems
More information about each of these features is available in the full documentation.
- Large range and high precision
- Supports date (and time) values in multiple calendar systems:
- Unix time
- TAI64
- Automatic calculation of leap second offsets
- Estimation of undefined past and future leap second insertions
- Automatic updates for handling leap second insertions
- Gregorian
- Disconnect from native
time.Time
implementation, and its limitations
- Disconnect from native
- Julian
- Julian Day Count
- Hebrew
- Persian
- Chinese
- Meso-American
- Discordian
- Stardate
- Encodes both time spans and instants in a single interface
- Supports calculations and comparisons on spans and instants
- Conversion to/from native date/time types
- Geo-temporally aware
- Time zone support
- Well-defined interfaces for extending the library
- Shared library (
.so
/.dll
/.dylib
) - WebAssembly binary
The steps here will vary based on which programming language(s) you're using.
For Golang, simply run go get github.com/danhunsaker/calends
, and then place
"github.com/danhunsaker/calends"
in the import
wherever you intend use it.
For other languages, refer to the full documentation.
Usage data has been moved to the full documentation.
Currently supported calendar systems, and the options available for each, are listed in the full documentation. Also provided there are the docs for how to add your own.
Pull requests are always welcome! That said, please be open to discussing the PR content, and possibly revising it if requested. Not all requests can be merged, and not all changes are desired.
Or, you can contribute some money, instead! Check out my Patreon for options, there. Other options will likely be added for one-time donations in the future.
Report all security-related issues to dan (dot) hunsaker (plus) calends (at)
gmail, and use PGP or GPG protections on
your message (the account's key is 44806AB9
, or you can look it up by the
email address). Security issues will be addressed internally before making any
vulnerability announcements.