GregorianCalendar.GetWeekOfYear : GregorianCalendar « Development « VB.Net






GregorianCalendar.GetWeekOfYear

 

Imports System
Imports System.Globalization

Public Class SamplesCalendar
   Public Shared Sub Main()
      Dim myCI As New CultureInfo("en-US")
      Dim myCal As Calendar = myCI.Calendar

      Dim myCWR As CalendarWeekRule = myCI.DateTimeFormat.CalendarWeekRule
      Dim myFirstDOW As DayOfWeek = myCI.DateTimeFormat.FirstDayOfWeek

      Console.WriteLine("The CalendarWeekRule used for the en-US culture is {0}.", myCWR)
      Console.WriteLine("The FirstDayOfWeek used for the en-US culture is {0}.", myFirstDOW)
      Console.WriteLine("Therefore, the current week is Week {0} of the current year.", myCal.GetWeekOfYear(DateTime.Now, myCWR, myFirstDOW))

   End Sub 'Main 
End Class 'SamplesCalendar

   
  








Related examples in the same category

1.GregorianCalendar.GetDaysInMonth
2.GregorianCalendar.GetDaysInYear
3.GregorianCalendar.GetMonthsInYear
4.GregorianCalendar.IsLeapDay
5.GregorianCalendar.IsLeapMonth
6.GregorianCalendar.IsLeapYear determines whether the specified year in the specified era is a leap year.
7.GregorianCalendar.MaxSupportedDateTime
8.GregorianCalendarTypes Enumeration defines the different language versions of the Gregorian calendar.