System.Globalization.CCHijriCalendar.fixed_from_dmy C# (CSharp) Method

fixed_from_dmy() public static method

The method returns the fixed day number of the given Islamic date.
public static fixed_from_dmy ( int day, int month, int year ) : int
day int An integer representing the day of the month, /// counting from 1. ///
month int An integer representing the month in the /// Islamic year. ///
year int An integer representing the Islamic year. /// Non-positive values are allowed also. ///
return int
	public static int fixed_from_dmy(int day, int month, int year) {
		int k = epoch - 1;
		k += 354 * (year-1);
		k += CCMath.div(3+11*year, 30);
		k += (int)System.Math.Ceiling(29.5 * (double)(month-1));
		k += day;

		return k;
	}

Usage Example

        public static void my_from_fixed(out int month, out int year, int date)
        {
            year = CCHijriCalendar.year_from_fixed(date);
            int num = 1 + (int)Math.Ceiling((double)(date - 29 - CCHijriCalendar.fixed_from_dmy(1, 1, year)) / 29.5);

            month = ((num >= 12) ? 12 : num);
        }
All Usage Examples Of System.Globalization.CCHijriCalendar::fixed_from_dmy