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

fixed_from_dmy() public static method

The method returns the fixed day number of the given Julian 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 /// Julian year. ///
year int An integer representing the Julian year. /// Positive and Negative values are allowed. ///
return int
	public static int fixed_from_dmy(int day, int month, int year) {
		int y = year < 0 ? year+1 : year;
		int k = epoch - 1;
		k += 365 * (y-1);
		k += CCMath.div(y-1, 4);
		k += CCMath.div(367*month-362, 12);
		if (month > 2) {
			k += is_leap_year(year) ? -1 : -2;
		}
		k += day;

		return k;
	}

Usage Example

Esempio n. 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"/> is outside the allowed range.
        /// </exception>
        public override int GetDaysInYear(int year, int era)
        {
            M_CheckYE(year, ref era);
            int rd1 = CCJulianCalendar.fixed_from_dmy(1, 1, year);
            int rd2 = CCJulianCalendar.fixed_from_dmy(1, 1, year + 1);

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