[RESOLVED] TimeZoneInfo.ConvertTimeBySystemTimeZoneId
Dim dt As Date = Date.Now
Message.Show(TimeZoneInfo.ConvertTimeBySystemTimeZoneId(dt, TimeZoneInfo.Local.Id, "Central Standard Time").ToString("t"))
This will convert my standard eastern time into Central Time. How about if I wanted to convert to Alaska time? I tried "Alaska" and "Alaska Standard Time" but didn't have any luck.
Re: TimeZoneInfo.ConvertTimeBySystemTimeZoneId
Hope this gives you some ideas
Code:
'show all
Dim lot As List(Of TimeZoneInfo) = TimeZoneInfo.GetSystemTimeZones.ToList
For Each tz As TimeZoneInfo In lot
Debug.WriteLine(tz.DaylightName & " " & tz.StandardName & " " & tz.Id)
Next
Dim s As String
Dim dt As Date = Date.Now
s = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(dt, TimeZoneInfo.Local.Id, "Alaskan Standard Time").ToString("t")
Debug.WriteLine(s)
Re: [RESOLVED] TimeZoneInfo.ConvertTimeBySystemTimeZoneId