Class CalendarSynchronizer

java.lang.Object
org.episteme.social.history.clock.CalendarSynchronizer

public final class CalendarSynchronizer extends Object
Utility for synchronizing dates across various historical, religious, and political calendars. Provides conversions between standard ISO-8601 (Gregorian) and systems like Hijri, French Republican, and Julian.
Since:
1.0
Version:
1.1
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Method Details

    • convertGregorian

      public static Map<String,String> convertGregorian(int year, int month, int day)
      Converts a Gregorian date to multiple chronological systems.
      Parameters:
      year - the Gregorian year
      month - the Gregorian month (1-12)
      day - the Gregorian day of month
      Returns:
      a map of system names to formatted date strings
      Throws:
      DateTimeException - if date components are invalid
    • julianToGregorianOffset

      public static int julianToGregorianOffset(int year)
      Calculates the offset in days between Julian and Gregorian calendars for a given year.

      Formula: Floor(Y/100) - Floor(Y/400) - 2

      Parameters:
      year - the year to calculate for
      Returns:
      day offset (positive means Gregorian is ahead)
    • isJulianLeapYear

      public static boolean isJulianLeapYear(int year)
      Determines if a year is a leap year in the Julian calendar. In the Julian system, every year divisible by 4 is a leap year.
      Parameters:
      year - the year to check
      Returns:
      true if leap year
    • toFrenchRepublican

      public static String toFrenchRepublican(LocalDate date)
      Converts a modern date to the French Republican Calendar (simplified model).

      Uses September 22, 1792 (Autumnal Equinox) as the Epoch (Year I). This implementation uses a fixed 365-day year model.

      Parameters:
      date - the date to convert
      Returns:
      formatted republican date string
      Throws:
      NullPointerException - if date is null