Date

class kanon.calendars.Date(calendar: kanon.calendars.Calendar, ymd: Tuple[int, int, int])[source] [edit on github]

Bases: object

Dataclass defining a date.

>>> cal = Calendar.registry["Julian A.D."]
>>> date = Date(cal, (1,2,3))
>>> str(date)
'3 Februarius 1 A.D. in Julian'
>>> date.jdn
1721457
>>> str(date + 1)
'4 Februarius 1 A.D. in Julian'

Attributes

calendar: kanon.calendars.Calendar

Calendar used in this date.

ymd: Tuple[int, int, int]

Year, month and days, expressed in the specified calendar.

jdn: float

Date as a julian day number.

Methods Summary

days_from_epoch()

Get number of days from the start of the calendar

to_calendar(cal)

Express this date in another calendar.

to_time()

Express this date as a astropy.time.Time object with jd format.

Methods Documentation

days_from_epoch()float[source] [edit on github]

Get number of days from the start of the calendar

to_calendar(cal: kanon.calendars.Calendar)kanon.calendars.Date[source] [edit on github]

Express this date in another calendar.

to_time()astropy.time.Time[source] [edit on github]

Express this date as a astropy.time.Time object with jd format.