GetDaysInMonth() public static méthode

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.
Résultat int
Exemple #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));
        }
Exemple #2
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 intger 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)
 {
     // mscorlib doesn't check year, probably a bug; we do
     M_CheckYME(year, month, ref era);
     return(CCGregorianCalendar.GetDaysInMonth(year, month));
 }