Skip to content

A library for handling dates and times across arbitrary calendar systems

License

Notifications You must be signed in to change notification settings

danhunsaker/calends

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Calends

Software License Main Docs GoDoc Reference Gitter Chat Total Downloads

Latest Stable Version GitHub Release Date Github commits (since latest release) GitHub last commit

Maintenance Status GitHub branch checks state Codecov coverage Go Report Card Libraries.io Dependency Check

Code Climate coverage Code Climate maintainability Code Climate technical debt Code Climate issues

Crowdin Liberapay receiving

A library for handling dates and times across arbitrary calendar systems

Features

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
    • 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

Installation

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

Usage data has been moved to the full documentation.

Calendar Systems

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.

Contributing

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.

Security Reporting

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.