C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
StandardName: The name of the current time zone (here it is Pacific Standard Time, PST).
DaylightName: The Day light Changes time zone name—so we know more about when the time changes each year.
VB.NET program that uses TimeZone, ToUniversalTime
Module Module1
Sub Main()
Dim zone As TimeZone = TimeZone.CurrentTimeZone
' Get standard and day light names.
Dim standard As String = zone.StandardName
Dim daylight As String = zone.DaylightName
Console.WriteLine("STANDARD NAME: " + standard)
Console.WriteLine("DAYLIGHT NAME: " + daylight)
' Get local and universal time for DateTime.Now.
Dim local As DateTime = zone.ToLocalTime(DateTime.Now)
Dim universal As DateTime = zone.ToUniversalTime(DateTime.Now)
Console.WriteLine("LOCAL TIME: " + local)
Console.WriteLine("UNIVERSAL TIME: " + universal)
End Sub
End Module
Output
STANDARD NAME: Pacific Standard Time
DAYLIGHT NAME: Pacific Daylight Time
LOCAL TIME: 7/7/2018 7:11:49 AM
UNIVERSAL TIME: 7/7/2018 2:11:49 PM