System.Globalization.CCGregorianCalendar.GetDaysInYear C# (CSharp) Method

GetDaysInYear() public static method

The method gives the number of days in the specified year.
public static GetDaysInYear ( int year ) : int
year int An integer that gives the year. ///
return int
	public static int GetDaysInYear(int year) {
		int rd1 = fixed_from_dmy(1, 1, year);
		int rd2 = fixed_from_dmy(1, 1, year+1);
		return rd2 - rd1;
	}

Usage Example

Example #1
0
        /// <summary>Returns the number of days in the specified year in the specified era.</summary>
        /// <returns>The number of days in the specified year in the specified era.</returns>
        /// <param name="year">An integer that represents the year. </param>
        /// <param name="era">An integer that represents the era. </param>
        /// <exception cref="T:System.ArgumentOutOfRangeException">
        ///   <paramref name="year" /> is outside the range supported by the calendar.-or- <paramref name="era" /> is outside the range supported by the calendar. </exception>
        public override int GetDaysInYear(int year, int era)
        {
            int year2 = this.M_CheckYEG(year, ref era);

            return(CCGregorianCalendar.GetDaysInYear(year2));
        }
All Usage Examples Of System.Globalization.CCGregorianCalendar::GetDaysInYear