1

Given a string of "EST", is there a way in .net (c#) to look up the standard name string like "Eastern Standard Time" in return? I know that TimeZoneInfo object has the StandardName field, but I cannot associate it with just the abbreviation.

I would hope to strictly do the look up in .net without accessing external web services.

Niner
  • 2,074
  • 6
  • 37
  • 47

1 Answers1

2

Given a string of "EST", is there a way in .net to look up the standard name string like "Eastern Standard Time" in return?

In .Net Framework, no. There is no upon standard to abbreviating time zone names. Hard to make one as well.

For example, CST can be represent;

  • China Standard Time
  • Central Standard Time (North America)
  • Central Standard Time (Australia)
  • Central Summer Time (Australia) (uses 3 time zones but..)

As far as I know, NodaTime both support Windows time zone and IANA/Olson time zone mapping. Also Matt Johnson created TimeZoneNames which is for preventing ambiguous time zone names and theirs localized names. You may wanna check these options.

Community
  • 1
  • 1
Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
  • TimeZoneNames is primarily for generating a name or abbreviation for display. Not for the other direction of parsing abbreviation to time zone. In theory, it could mostly be done if you had an abbreviation AND a country code, but there would still be some ambiguous edge cases. – Matt Johnson-Pint May 07 '15 at 17:29
  • @MattJohnson Oh. I thought since there is a method as `TimeZoneNames.GetAbbreviationsForTimeZone` maybe there _is_ a method also doing the opposite thing as well. But of course, as you said, probably, ambiguous cases will be always there even we use them with country codes . – Soner Gönül May 08 '15 at 07:05