GregorianCalendar.IsLeapYear determines whether the specified year in the specified era is a leap year. : GregorianCalendar « Development « VB.Net






GregorianCalendar.IsLeapYear determines whether the specified year in the specified era is a leap year.

 

Imports System
Imports System.Globalization
Imports Microsoft.VisualBasic

Public Class SamplesGregorianCalendar   
   Public Shared Sub Main()
      Dim myCal As New GregorianCalendar()
      ' Checks five years in the current era.
      For y = 2001 To 2005
         Console.Write(ControlChars.Tab + "{0}", myCal.IsLeapYear(y, GregorianCalendar.CurrentEra))
      Next y
      Console.WriteLine()

      ' Checks five years in each of the eras.
      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.IsLeapYear(y, myCal.Eras(i)))
         Next y
         Console.WriteLine()
      Next i
   End Sub 
End Class 

   
  








Related examples in the same category

1.GregorianCalendar.GetDaysInMonth
2.GregorianCalendar.GetDaysInYear
3.GregorianCalendar.GetMonthsInYear
4.GregorianCalendar.GetWeekOfYear
5.GregorianCalendar.IsLeapDay
6.GregorianCalendar.IsLeapMonth
7.GregorianCalendar.MaxSupportedDateTime
8.GregorianCalendarTypes Enumeration defines the different language versions of the Gregorian calendar.