Name

TimeZone

Synopsis

This MustInherit class encapsulates a time zone. You cannot create a TimeZone instance directly because different time zones require different implementations of methods that involve time offsets due to daylight savings time. The most useful member of the TimeZone class is the shared CurrentTimeZone property, which provides a TimeZone object based on the localization settings of the current system.

Public MustInherit Class TimeZone
                  ' Protected Constructors
   Protected Sub New() 
' Public Shared Properties
   Public Shared ReadOnly Property CurrentTimeZone As TimeZone  
' Public Instance Properties
   MustInherit Public ReadOnly Property DaylightName As String  
   MustInherit Public ReadOnly Property StandardName As String  
' Public Shared Methods
   Public Shared Function IsDaylightSavingTime(
        ByVal time As Date, 
        ByVal daylightTimes As System.Globalization.DaylightTime) As Boolean  
' Public Instance Methods
   MustInherit Public Function GetDaylightChanges(
        ByVal year As Integer) As DaylightTime  
   MustInherit Public Function GetUtcOffset(
        ByVal time As Date) As TimeSpan  
   Overridable Public Function IsDaylightSavingTime(
        ByVal time As Date) As Boolean  
   Overridable Public Function ToLocalTime(
        ByVal time As Date) As Date  
   Overridable Public Function ToUniversalTime(
        ByVal time As Date) As Date  
End Class

Get VB.NET Core Classes in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.