.NET Convert number to TimeZone value

Let's say I have a value: -5 that represents TimeZone (GMT-5).

How can I convert this to: "Central DST" or something similar textual using C # and .NET framework?

Thank!

+1


source to share


1 answer


Using .NET 3.5 you can use TimeZoneInfo.GetSystemTimeZones () and then iterate until you find a match using BaseUtcOffset.



Be warned that there can be multiple records per offset, so your results will be somewhat arbitrary.

+3


source







All Articles