예제 #1
0
        public static double ToJulianDay(int year, int month, double day)
        {
            double jd;

            if (year > REFORM_YEAR)
            {
                jd = GregorianCalendar.ToJulianDay(year, month, day);
            }
            else if (year < REFORM_YEAR)
            {
                jd = JulianCalendar.ToJulianDay(year, month, day);
            }
            else if (month > REFORM_MONTH)
            {
                jd = GregorianCalendar.ToJulianDay(year, month, day);
            }
            else if (month < REFORM_MONTH)
            {
                jd = JulianCalendar.ToJulianDay(year, month, day);
            }
            else if (day >= 15.0)
            {
                jd = GregorianCalendar.ToJulianDay(year, month, day);
            }
            else if (day < 5.0)
            {
                jd = JulianCalendar.ToJulianDay(year, month, day);
            }
            else
            {
                throw new ArgumentOutOfRangeException("Invalid date: Date cannot be between Oct 4, 1582 and Oct 15, 1582");
            }

            return(jd);
        }
예제 #2
0
 public static Date FromJulianDay(double JD) => (JD < REFORM_JULIAN_DAY) ? JulianCalendar.FromJulianDay(JD)
                                                                         : GregorianCalendar.FromJulianDay(JD);
예제 #3
0
 public static bool IsLeapYear(int year) => year <= REFORM_YEAR?JulianCalendar.IsLeapYear(year)
     : GregorianCalendar.IsLeapYear(year);
예제 #4
0
 private JulianCalendar(JulianCalendar date)
     : base(date)
 {
 }