0

I am looking for a way to output/format

String.Format("{0:h:MMtt zzzz}", symbol.QuoteData.LastTrade);

into more meaningful format like

String.Format("{0:h:MMtt EST}", symbol.QuoteData.LastTrade);
Artem Gassan
  • 45
  • 1
  • 5
  • possible duplicate of [Get DateTime For Another Time Zone Regardless of Local Time Zone](http://stackoverflow.com/questions/441109/get-datetime-for-another-time-zone-regardless-of-local-time-zone) – Brad Christie Nov 10 '11 at 15:50
  • Brad I do not want to convert DateTime into different time zone. I am well aware about TimeZoneInfo class. I need to output DataTime as is regardless it TimeZone. I only need to show it in words and not numbers. I can always create TimeZone Dictionary and perform a lookup. – Artem Gassan Nov 10 '11 at 16:05
  • It appears that the lookup table doesn't exist in .NET. You can make one yourself or perhaps check out the library mentioned here: http://stackoverflow.com/questions/180370/how-to-display-datetime-with-an-abbreviated-time-zone/181253#181253 – Jim Mischel Nov 10 '11 at 16:35
  • Just checked and TZ4Net uses registry. I am not a big fun on of this approach. Found this useful list of timezones. http://madskristensen.net/post/List-time-zones-in-ASPNET.aspx – Artem Gassan Nov 10 '11 at 16:51

1 Answers1

0

Take a look at the TimeZoneInfo class (assuming you are .NET 3.5 or later?). The first thing to note is that there is no definitive list of 3 char time zone mnemonics, as far as I know of anyway. If have seen lists online, but they all contain duplicates! I realize this answer is a bit vague. If you can give more detail I'll try to be more specific.

Myles McDonnell
  • 12,943
  • 17
  • 66
  • 116
  • Use ReadOnlyCollection tz = TimeZoneInfo.GetSystemTimeZones(); Or simple list http://madskristensen.net/post/List-time-zones-in-ASPNET.aspx – Artem Gassan Nov 10 '11 at 16:57