private static int DaysInYear(double year){ if (year % 4 != 0.0) return 365; if (year % 100 != 0.0) return 366; if (year % 400 != 0.0) return 365; return 366; }