Mega Code Archive

 
Categories / C# Tutorial / Date Time
 

Call GetDaysInMonth for the second month in each of five years in each era

using System; using System.Globalization; public class MainClass {    public static void Main()  {       GregorianCalendar myCal = new GregorianCalendar();       // .       for ( int i = 0; i < myCal.Eras.Length; i++ )  {          Console.Write( "Era {0}:\t", myCal.Eras[i] );          for ( int y = 2001; y <= 2005; y++ ){             Console.Write( "\t{0}", myCal.GetDaysInMonth( y, 2, myCal.Eras[i] ) );                   }       }    } }