Mega Code Archive

 
Categories / C# Tutorial / Date Time
 

Displays the value of the CurrentEra property with GregorianCalendar CurrentEra

using System; using System.Globalization; public class MainClass {    public static void Main()  {       GregorianCalendar myCal = new GregorianCalendar();       // Displays the value of the CurrentEra property.       Console.Write( "CurrentEra:" );       for ( int y = 2001; y <= 2005; y++ )          Console.Write( "\t{0}", myCal.GetDaysInMonth( y, 2, GregorianCalendar.CurrentEra ) );    } }