System.Globalization.CCHebrewCalendar.year_from_fixed C# (CSharp) Méthode

year_from_fixed() public static méthode

The method computes the Hebrew year from a fixed day number.
public static year_from_fixed ( int date ) : int
date int The fixed day number. ///
Résultat int
	public static int year_from_fixed(int date) {
		int approx = (int)System.Math.Floor(
			((double)(date - epoch))/(35975351.0/98496.0));
		int y;
		for (y = approx; date >= fixed_from_dmy(1, 7, y); y++) {} 
		return y-1;
	}

Usage Example

Exemple #1
0
        /// <summary>
        /// Overridden. Gives the number of the year of the specified
        /// date.
        /// </summary>
        /// <param name="time">The
        /// <see cref="T:System.DateTime"/> that specifies a
        /// date.
        /// </param>
        /// <returns>An integer representing the year,
        /// starting with 1.</returns>
        /// <exception cref="T:System.ArgumentOutOfRangeException">
        /// The exception is thrown if the
        /// <see cref="T:System.DateTime"/> parameter is not in the years
        /// between 5343 A.M. and 6000 A.M., inclusive.
        /// </exception>
        public override int GetYear(DateTime time)
        {
            M_CheckDateTime(time);
            int rd = CCFixed.FromDateTime(time);

            return(CCHebrewCalendar.year_from_fixed(rd));
        }
All Usage Examples Of System.Globalization.CCHebrewCalendar::year_from_fixed