pub struct Julian;Expand description
The Julian Calendar.
The Julian calendar is a solar calendar that was introduced in the Roman Republic under
Julius Caesar in 45 BCE, and used in Europe and much of the western world until it was
eventually replaced by the more accurate Gregorian calendar.
This implementation extends proleptically for dates before the calendar’s creation.
While no country uses the Julian calendar as its civil calendar today, it is still used by eastern Christian churches to determine lithurgical dates like Christmas and Easter.
§Era codes
This calendar uses two era codes: bce (alias bc), and ce (alias ad), corresponding to the BCE and CE eras.
§Months and days
The 12 months are called January (M01, 31 days), February (M02, 28 days),
March (M03, 31 days), April (M04, 30 days), May (M05, 31 days), June (M06, 30 days),
July (M07, 31 days), August (M08, 31 days), September (M09, 30 days),
October (M10, 31 days), November (M11, 30 days), December (M12, 31 days).
In leap years (years divisible by 4), February gains a 29th day.
Standard years thus have 365 days, and leap years 366.
§Calendar drift
The Julian calendar has an average year length of 365.25, slightly longer than the mean solar year, so this calendar drifts 1 day in ~128 years with respect to the seasons. This significant drift was the reason for its replacement by the Gregorian calendar. The Julian calendar is currently 14 days ahead of the Gregorian calendar and the solar year.
§Historical accuracy
Historically, a variety of year reckoning schemes have been used with the Julian calendar, such as Roman consular years, regnal years, indictions, Anno Mundi, the Diocletian era, Anno Domini, and the (equivalent) Common era. The latter, which is used today and by this implementation, has been used by western European authorities since the early middle ages, however some eastern European countries/churches have not adopted it until fairly recently, or, in some cases, are still using a different year reckoning scheme.
Also during the middle ages, some countries used different dates for the first day of the year, ranging from late December to late March. Care has to be taken when interpreting year numbers with dates in this range.
The calendar was used incorrectly for a while after adoption, so the first year where the months align with this proleptic implementation is probably 4 CE.
Implementations§
Trait Implementations§
Source§impl Calendar for Julian
impl Calendar for Julian
Source§fn year_info(&self, date: &Self::DateInner) -> Self::Year
fn year_info(&self, date: &Self::DateInner) -> Self::Year
The calendar-specific year represented by date
Julian has the same era scheme as Gregorian
Source§fn month(&self, date: &Self::DateInner) -> MonthInfo
fn month(&self, date: &Self::DateInner) -> MonthInfo
The calendar-specific month represented by date
Source§fn day_of_month(&self, date: &Self::DateInner) -> DayOfMonth
fn day_of_month(&self, date: &Self::DateInner) -> DayOfMonth
The calendar-specific day-of-month represented by date
Source§type DateInner = JulianDateInner
type DateInner = JulianDateInner
Source§type DifferenceError = Infallible
type DifferenceError = Infallible
untilSource§fn from_codes(
&self,
era: Option<&str>,
year: i32,
month_code: MonthCode,
day: u8,
) -> Result<Self::DateInner, DateError>
fn from_codes( &self, era: Option<&str>, year: i32, month_code: MonthCode, day: u8, ) -> Result<Self::DateInner, DateError>
Source§fn has_cheap_iso_conversion(&self) -> bool
fn has_cheap_iso_conversion(&self) -> bool
from_iso/to_iso is more efficient
than from_rata_die/to_rata_die.Source§fn months_in_year(&self, date: &Self::DateInner) -> u8
fn months_in_year(&self, date: &Self::DateInner) -> u8
Source§fn days_in_year(&self, date: &Self::DateInner) -> u16
fn days_in_year(&self, date: &Self::DateInner) -> u16
Source§fn days_in_month(&self, date: &Self::DateInner) -> u8
fn days_in_month(&self, date: &Self::DateInner) -> u8
Source§fn is_in_leap_year(&self, date: &Self::DateInner) -> bool
fn is_in_leap_year(&self, date: &Self::DateInner) -> bool
Source§fn day_of_year(&self, date: &Self::DateInner) -> DayOfYear
fn day_of_year(&self, date: &Self::DateInner) -> DayOfYear
Source§fn debug_name(&self) -> &'static str
fn debug_name(&self) -> &'static str
Source§fn calendar_algorithm(&self) -> Option<CalendarAlgorithm>
fn calendar_algorithm(&self) -> Option<CalendarAlgorithm>
CalendarAlgorithm that is required to match
when parsing into this calendar. Read more