GregorianCalendar.IsLeapDay
Imports System
Imports System.Globalization
Imports Microsoft.VisualBasic
Public Class SamplesGregorianCalendar
Public Shared Sub Main()
Dim myCal As New GregorianCalendar()
Dim iLastDay As Integer
' Checks five years in the current era.
Console.Write("CurrentEra:")
For y = 2001 To 2005
iLastDay = myCal.GetDaysInMonth(y, 2, GregorianCalendar.CurrentEra)
Console.Write(ControlChars.Tab + "{0}", myCal.IsLeapDay(y, 2, iLastDay, GregorianCalendar.CurrentEra))
Next y
End Sub
End Class
Related examples in the same category