Month Property

TimeZoneInfo.TransitionTime.Month Property

Gets the month in which the time change occurs.

Namespace:  System
Assembly:  System.Core (in System.Core.dll)

Public ReadOnly Property Month As Integer
Dim instance As TimeZoneInfo..::.TransitionTime 
Dim value As Integer 

value = instance.Month

Property Value

Type: System.Int32
The month in which the time change occurs.

Valid values for the Month property range from 1 to 12.

The Month property is used for both fixed-date and floating-date rules.

The following example enumerates the time zones found on the local computer and displays transition time information for all floating-date transitions. The time information includes the month in which the time change occurs.

Private Enum WeekOfMonth As Integer
   First = 1
   Second = 2
   Third = 3
   Fourth = 4
   Last = 5 
End Enum 

Private Sub GetFloatingTransitionTimes()
   Dim timeZones As ReadOnlyCollection(Of TimeZoneInfo) = TimeZoneInfo.GetSystemTimeZones()
   For Each zone As TimeZoneInfo In timeZones
      Dim adjustmentRules() As TimeZoneInfo.AdjustmentRule = zone.GetAdjustmentRules()
      For Each adjustmentRule As TimeZoneInfo.AdjustmentRule in adjustmentRules
         Dim daylightStart As TimeZoneInfo.TransitionTime = adjustmentRule.DaylightTransitionStart
         If Not daylightStart.IsFixedDateRule Then
            Console.WriteLine("{0}, {1:d}-{2:d}: Begins at {3:t} on the {4} {5} of {6}.", _
                              zone.StandardName, _
                              adjustmentRule.DateStart, _
                              adjustmentRule.DateEnd, _                                 
                              daylightStart.TimeOfDay, _
                              CType(daylightStart.Week, WeekOfMonth).ToString(), _ 
                              daylightStart.DayOfWeek.ToString(), _
         End If 
         Dim daylightEnd As TimeZoneInfo.TransitionTime = adjustmentRule.DaylightTransitionEnd
         If Not daylightEnd.IsFixedDateRule Then
            Console.WriteLine("{0}, {1:d}-{2:d}: Ends at {3:t} on the {4} {5} of {6}.", _
                              zone.StandardName, _
                              adjustmentRule.DateStart, _
                              adjustmentRule.DateEnd, _                                 
                              daylightEnd.TimeOfDay, _
                              CType(daylightEnd.Week, WeekOfMonth).ToString(), _ 
                              daylightEnd.DayOfWeek.ToString(), _
         End If    
End Sub

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5

Community Additions

© 2016 Microsoft