Date

class kanon.calendars.Date(calendar: ~kanon.calendars.calendars.Calendar, ymd: ~typing.Tuple[int, int, int], hours: float | ~numbers.Real = 12 ; )[source] [edit on github]

Bases: object

Dataclass defining a date.

>>> cal = Calendar.registry["Julian A.D."]
>>> date = Date(cal, (1,2,3), 13)
>>> str(date)
'3 Februarius 1 A.D. in Julian 13:00'
>>> date.jdn
1721457.0416666667
>>> str(date + 1)
'4 Februarius 1 A.D. in Julian 13:00'
Parameters:
  • calendar (Calendar) – Calendar used in this date.

  • ymd (Tuple[int, int, int]) – Year, month and days, expressed in the specified calendar.

  • hours (Real, optional) – Number of hours, defaults to Sexagesimal(12);

Attributes Summary

calendar

Calendar used in this date.

hours

Number of hours

jdn

Date as a julian day number.

ymd

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

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.

Attributes Documentation

calendar

Calendar used in this date.

Return type:

Calendar

hours

Number of hours

Return type:

Sexagesimal

jdn

Date as a julian day number.

Return type:

float

ymd

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

Return type:

Tuple[int, int, int]

Methods Documentation

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

Get number of days from the start of the calendar

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

Express this date in another calendar.

to_time() Time[source] [edit on github]

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