Gets a TimeZoneInfo object that represents the local time zone.
Module Example
Public Sub Main()
Dim date1 As Date = #3/21/2010 2:00AM#
Console.WriteLine(date1.ToUniversalTime())
Console.WriteLine(TimeZoneInfo.ConvertTimeToUtc(date1))
Console.WriteLine(TimeZoneInfo.ConvertTimeToUtc(date1, TimeZoneInfo.Local))
Dim tz As TimeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time")
Console.WriteLine(TimeZoneInfo.ConvertTimeToUtc(date1, tz))
End Sub
End Module
Related examples in the same category