IsLeapDay() public static method

A virtual method that tells whether the given day is a leap day.
public static IsLeapDay ( int year, int month, int day ) : bool
year int An integer that specifies the year. ///
month int An integer that specifies the month. ///
day int An integer that specifies the day. ///
return bool
示例#1
0
        /// <summary>Determines whether the specified date in the specified era is a leap day.</summary>
        /// <returns>true if the specified day is a leap day; otherwise, false.</returns>
        /// <param name="year">An integer that represents the year. </param>
        /// <param name="month">An integer from 1 to 12 that represents the month. </param>
        /// <param name="day">An integer from 1 to 31 that represents the day. </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="month" /> is outside the range supported by the calendar.-or- <paramref name="day" /> is outside the range supported by the calendar.-or- <paramref name="era" /> is outside the range supported by the calendar. </exception>
        public override bool IsLeapDay(int year, int month, int day, int era)
        {
            int year2 = this.M_CheckYMDEG(year, month, day, ref era);

            return(CCGregorianCalendar.IsLeapDay(year2, month, day));
        }
示例#2
0
	/// <summary>
	/// Overridden. Tells whether the given day 
	/// is a leap day.
	/// </summary>
	/// <param name="year">An integer that specifies the year in the
	/// given era.
	/// </param>
	/// <param name="month">An integer that specifies the month.
	/// </param>
	/// <param name="day">An integer that specifies the day.
	/// </param>
	/// <param name="era">An integer that specifies the era.
	/// </param>
	/// <returns>A boolean that tells whether the given day is a leap
	/// day.
	/// </returns>
	/// <exception cref="T:System.ArgumentOutOfRangeException">
	/// The exception is thrown, if the year, month, day, or era is not
	/// valid.
	/// </exception>
	public override bool IsLeapDay(int year, int month, int day, int era)
	{
		int gregorianYear = M_CheckYMDEG(year, month, day, ref era);
		return CCGregorianCalendar.IsLeapDay(gregorianYear, month, day);
	}