GregorianCalendar.GetDaysInMonth : GregorianCalendar « Date Time « C# / C Sharp






GregorianCalendar.GetDaysInMonth

 

using System;
using System.Globalization;

public class SamplesGregorianCalendar  {
   public static void Main()  {
      GregorianCalendar myCal = new GregorianCalendar();
      for ( int y = 2001; y <= 2010; y++ )
         Console.Write(myCal.GetDaysInMonth( y, 2, GregorianCalendar.CurrentEra ) );
      for ( int i = 0; i < myCal.Eras.Length; i++ )  {
         Console.Write( myCal.Eras[i] );
         for ( int y = 2001; y <= 2010; y++ )
            Console.WriteLine(myCal.GetDaysInMonth( y, 2, myCal.Eras[i] ) );
      }
   }
}

   
  








Related examples in the same category

1.GregorianCalendar Class
2.GregorianCalendar Constructor
3.GregorianCalendar.AddMonths
4.GregorianCalendar.GetDayOfMonth
5.GregorianCalendar.GetDaysInYear
6.GregorianCalendar.GetMonthsInYear
7.GregorianCalendar.GetWeekOfYear
8.GregorianCalendar.IsLeapDay
9.GregorianCalendar.IsLeapMonth
10.GregorianCalendar.IsLeapYear
11.GregorianCalendar.MaxSupportedDateTime
12.GregorianCalendarTypes Enumeration