Date¶
- class kanon.calendars.Date(calendar: kanon.calendars.calendars.Calendar, ymd: Tuple[int, int, int], frac: float = 0.5)[source] [edit on github]¶
Bases:
object
Dataclass defining a date.
>>> cal = Calendar.registry["Julian A.D."] >>> date = Date(cal, (1,2,3), hm_to_float(13, 0)) >>> 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
Attributes Summary
Calendar used in this date.
Fraction of day, 0.5 == 12:00
Date as a julian day number.
Year, month and days, expressed in the specified calendar.
Methods Summary
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 withjd
format.Attributes Documentation
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.calendars.Calendar) → kanon.calendars.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 withjd
format.