0

Possible Duplicate:
How to display DateTime with an abbreviated Time Zone?

Iam displaying time from database table. Now I want to display that datetime in my webpage with timezone like IST,PST,EST,CST.

By using C# datetime formatspecifiers.

Convert.ToDateTime(ds_E2A.Tables[0].Rows[0][2]).ToString("MM/dd/yyyy HH:mm:ss zz")  

The above displays like this 11/12/2012 21:10:10 +05. Instead of +05 I want to display IST,PST,EST.

I used Convert.ToDateTime(ds_E2A.Tables[0].Rows[0][2]).ToString("r"). It displays GMT at the end of time. But I want to display current timezone.

I used TimeZoneInfo and TimeZone classes in C#.

If Iam getting data from india I want to display as IST or any other country PST or CST

I want to display as 11/12/2012 21:10:10 PST

Thanks in advance

Community
  • 1
  • 1
Nag
  • 689
  • 1
  • 5
  • 15
  • 1
    According to http://www.timeanddate.com/library/abbreviations/timezones/ there are 11 distinct time zones which are UTC + 5 hours. When the system retrieves a time from the database with an offset of +5 hours, how should it know which of the 11 time zone abbreviations to display? – Adam Ralph Nov 27 '12 at 06:40
  • +1 for @AdamRalph Thats a good link from timedate.com. Atleast I want to get the major timezones like `PST`,`EST` – Nag Nov 27 '12 at 06:48
  • You can also give a look at [`TimeZoneInfo`](http://msdn.microsoft.com/en-us/library/system.timezoneinfo(v=vs.90).aspx). Adding that to what is given above, you should find something interesting. – Nick.T Nov 27 '12 at 09:29

0 Answers0