System.Globalization.CCGregorianCalendar.GetDaysInMonth C# (CSharp) Метод

GetDaysInMonth() публичный статический Метод

A method that gives the number of days of the specified month of the year.
public static GetDaysInMonth ( int year, int month ) : int
year int An integer that gives the year in the current /// era.
month int An integer that gives the month, starting /// with 1.
Результат int
	public static int GetDaysInMonth(int year, int month) {
		int rd1 = fixed_from_dmy(1, month, year);
		int rd2 = fixed_from_dmy(1, month+1, year);
		return rd2 - rd1;
	}

Usage Example

Пример #1
0
        /// <summary>
        /// Overridden. Gives the number of days in the specified month
        /// of the given year and era.
        /// </summary>
        /// <param name="year">An integer that gives the year.
        /// </param>
        /// <param name="month">An integer that gives the month, starting
        /// with 1.</param>
        /// <param name="era">An integer that gives the era of the specified
        /// year.</param>
        /// <returns>An integer that gives the number of days of the
        /// specified month.</returns>
        /// <exception cref="T:System.ArgumentOutOfRangeException">
        /// The exception is thrown, if <paramref name="month"/>,
        /// <paramref name="year"/> ,or <paramref name="era"/> is outside
        /// the allowed range.
        /// </exception>
        public override int GetDaysInMonth(int year, int month, int era)
        {
            int gregorianYear = M_CheckYMEG(year, month, ref era);

            return(CCGregorianCalendar.GetDaysInMonth(gregorianYear, month));
        }
All Usage Examples Of System.Globalization.CCGregorianCalendar::GetDaysInMonth