コード例 #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)
 {
 }