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

fixed_from_dmy() public static method

The method returns the fixed day number of the given Hebrew 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 /// Hebrew year. ///
year int An integer representing the Hebrew year. /// Non-positive values are allowed also. ///
return int
	public static int fixed_from_dmy(int day, int month, int year) {
		int m;
		int k = epoch-1;
		k += elapsed_days(year);
		k += new_year_delay(year);

		if (month < 7) {
			int l = last_month_of_year(year);
			for (m = 7; m <= l; m++) {
				k += last_day_of_month(m, year);
			}
			for (m = 1; m < month; m++) {
				k += last_day_of_month(m, year);
			}
		}
		else {
			for (m = 7; m < month; m++) {
				k += last_day_of_month(m, year);
			}
		}
		
		k += day;

		return k;
	}

Usage Example

Example #1
0
        /// <summary>
        /// Overridden. Gives the number of days of the specified
        /// year of the given era.
        /// </summary>
        /// <param name="year">An integer that specifies the year.
        /// </param>
        /// <param name="era">An ineger that specifies the era.
        /// </param>
        /// <returns>An integer that gives the number of days of the
        /// specified year.</returns>
        /// <exception cref="T:System.ArgumentOutOfRangeExceiption">
        /// The exception is thrown, if
        /// <paramref name="year"/> or <paramref name="era"/> are outside the
        /// allowed range.
        /// </exception>
        public override int GetDaysInYear(int year, int era)
        {
            M_CheckYE(year, ref era);
            int rd1 = CCHebrewCalendar.fixed_from_dmy(1, 7, year);
            int rd2 = CCHebrewCalendar.fixed_from_dmy(1, 7, year + 1);

            return(rd2 - rd1);
        }
All Usage Examples Of System.Globalization.CCHebrewCalendar::fixed_from_dmy