Mega Code Archive

 
Categories / VB.Net / Date Time
 

Creates a time zone with identifier, an offset from Coordinated Universal Time (UTC), a display name, and a standard time displa

Module Example    Public Sub Main()         Dim displayName As String = "(GMT+06:00) Antarctica/Mawson Time"         Dim standardName As String = "Standard Time"          Dim offset As TimeSpan = New TimeSpan(06, 00, 00)         Dim mawson As TimeZoneInfo = TimeZoneInfo.CreateCustomTimeZone(standardName, offset, displayName, standardName)         Console.WriteLine("The current time is {0} {1}", _                            TimeZoneInfo.ConvertTime(Date.Now, TimeZoneInfo.Local, mawson), _                           mawson.StandardName)          End Sub End Module