Imports System
Imports System.Globalization
Imports Microsoft.VisualBasic
Public Class SamplesGregorianCalendar
Public Shared Sub Main()
Dim myCal As New GregorianCalendar()
Console.Write("YEAR" + ControlChars.Tab)
Dim y As Integer
For y = 2001 To 2005
Console.Write(ControlChars.Tab + "{0}", y)
Next y
Console.Write("CurrentEra:")
For y = 2001 To 2005
Console.Write(ControlChars.Tab + "{0}", myCal.GetDaysInMonth(y, 2, GregorianCalendar.CurrentEra))
Next y
Console.WriteLine()
Dim i As Integer
For i = 0 To myCal.Eras.Length - 1
Console.Write("Era {0}:" + ControlChars.Tab, myCal.Eras(i))
For y = 2001 To 2005
Console.Write(ControlChars.Tab + "{0}", myCal.GetDaysInMonth(y, 2, myCal.Eras(i)))
Next y
Console.WriteLine()
Next i
End Sub
End Class
|