Created
April 4, 2011 13:56
-
-
Save jdaigle/901662 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static TimeZoneInfo ToTimeZoneInfo(this TimeZones zone) { | |
switch (zone) { | |
case TimeZones.Central: | |
return TimeZoneInfo.FindSystemTimeZoneById("Central Standard Time"); | |
case TimeZones.Mountain: | |
return TimeZoneInfo.FindSystemTimeZoneById("Mountain Standard Time"); | |
case TimeZones.Pacific: | |
return TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time"); | |
case TimeZones.Arizona: | |
return TimeZoneInfo.FindSystemTimeZoneById("US Mountain Standard Time"); | |
case TimeZones.Alaska: | |
return TimeZoneInfo.FindSystemTimeZoneById("Alaskan Standard Time"); | |
case TimeZones.Hawaii: | |
return TimeZoneInfo.FindSystemTimeZoneById("Hawaiian Standard Time"); | |
case TimeZones.Indiana: | |
return TimeZoneInfo.FindSystemTimeZoneById("US Eastern Standard Time"); | |
case TimeZones.Eastern: | |
case TimeZones.NotSet: | |
default: | |
return TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment