Skip to content

mstetson/ratadie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rata Die: A Go package for representing dates as fixed integers.

Installation

go get github.com/mstetson/ratadie

Usage

See godoc for details.

GoDoc

Other software

Notes on using Rata Die dates with other tools.

MySQL

MySQL supports ordinal dates with a different epoch from Rata Die. To convert a Rata Die N to a MySQL date, use from_days(N+365). To convert a MySQL date D to a Rata Die, use to_days(D)-365.

Python

Python has direct support for Rata Die dates, calling them "proleptic Gregorian ordinals". To convert a Rata Die N to a Python date object, use datetime.date.fromordinal(N). To convert a Python date object D to a Rata Die, use D.toordinal().

License

This software is released into the public domain. See LICENSE for details.

Thanks to SchoolsPLP, LLC for funding part of the work and allowing this code to be released freely.

About

Fixed integer dates in Go

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages