go get github.com/mstetson/ratadie
See godoc for details.
Notes on using Rata Die dates with other tools.
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 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()
.
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.