System.Globalization.CCJulianCalendar.is_leap_year C# (CSharp) Method

is_leap_year() public static method

The method tells whether the year is a leap year.
public static is_leap_year ( int year ) : bool
year int An integer representing the Julian year. ///
return bool
	public static bool is_leap_year(int year) {
		return CCMath.mod(year, 4) == (year > 0 ? 0 : 3);
	}

Usage Example

        public static int fixed_from_dmy(int day, int month, int year)
        {
            int num  = (year >= 0) ? year : (year + 1);
            int num2 = -2;

            num2 += 365 * (num - 1);
            num2 += CCMath.div(num - 1, 4);
            num2 += CCMath.div(367 * month - 362, 12);
            if (month > 2)
            {
                num2 += ((!CCJulianCalendar.is_leap_year(year)) ? -2 : -1);
            }
            return(num2 + day);
        }
All Usage Examples Of System.Globalization.CCJulianCalendar::is_leap_year