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: &<Julian as Calendar>::DateInner,
) -> <Julian as Calendar>::Year
fn year_info( &self, date: &<Julian as Calendar>::DateInner, ) -> <Julian as Calendar>::Year
The calendar-specific year represented by date
Julian has the same era scheme as Gregorian
Source§fn month(&self, date: &<Julian as Calendar>::DateInner) -> MonthInfo
fn month(&self, date: &<Julian as Calendar>::DateInner) -> MonthInfo
The calendar-specific month represented by date
Source§fn day_of_month(&self, date: &<Julian as Calendar>::DateInner) -> DayOfMonth
fn day_of_month(&self, date: &<Julian as Calendar>::DateInner) -> DayOfMonth
The calendar-specific day-of-month represented by date
Source§type DifferenceError = Infallible
type DifferenceError = Infallible
untilSource§fn from_codes(
&self,
era: Option<&str>,
year: i32,
month_code: MonthCode,
day: u8,
) -> Result<<Julian as Calendar>::DateInner, DateError>
fn from_codes( &self, era: Option<&str>, year: i32, month_code: MonthCode, day: u8, ) -> Result<<Julian as Calendar>::DateInner, DateError>
Source§fn from_rata_die(&self, rd: RataDie) -> <Julian as Calendar>::DateInner
fn from_rata_die(&self, rd: RataDie) -> <Julian as Calendar>::DateInner
RataDieSource§fn to_rata_die(&self, date: &<Julian as Calendar>::DateInner) -> RataDie
fn to_rata_die(&self, date: &<Julian as Calendar>::DateInner) -> RataDie
RataDie from this dateSource§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: &<Julian as Calendar>::DateInner) -> u8
fn months_in_year(&self, date: &<Julian as Calendar>::DateInner) -> u8
Source§fn days_in_year(&self, date: &<Julian as Calendar>::DateInner) -> u16
fn days_in_year(&self, date: &<Julian as Calendar>::DateInner) -> u16
Source§fn days_in_month(&self, date: &<Julian as Calendar>::DateInner) -> u8
fn days_in_month(&self, date: &<Julian as Calendar>::DateInner) -> u8
Source§fn is_in_leap_year(&self, date: &<Julian as Calendar>::DateInner) -> bool
fn is_in_leap_year(&self, date: &<Julian as Calendar>::DateInner) -> bool
Source§fn day_of_year(&self, date: &<Julian as Calendar>::DateInner) -> DayOfYear
fn day_of_year(&self, date: &<Julian as Calendar>::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 moreSource§fn from_iso(&self, iso: IsoDateInner) -> Self::DateInner
fn from_iso(&self, iso: IsoDateInner) -> Self::DateInner
Source§fn to_iso(&self, date: &Self::DateInner) -> IsoDateInner
fn to_iso(&self, date: &Self::DateInner) -> IsoDateInner
Source§fn extended_year(&self, date: &Self::DateInner) -> i32
fn extended_year(&self, date: &Self::DateInner) -> i32
Source§impl Ord for Julian
impl Ord for Julian
Source§impl PartialOrd for Julian
impl PartialOrd for Julian
impl Copy for Julian
impl Eq for Julian
impl StructuralPartialEq for Julian
Auto Trait Implementations§
impl Freeze for Julian
impl RefUnwindSafe for Julian
impl Send for Julian
impl Sync for Julian
impl Unpin for Julian
impl UnwindSafe for Julian
Blanket Implementations§
Source§impl<C> AsCalendar for Cwhere
C: Calendar,
impl<C> AsCalendar for Cwhere
C: Calendar,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more