How to display DateTime with an abbreviated Time Zone?

前端 未结 8 980
长情又很酷
长情又很酷 2020-12-08 19:02

I am aware of the System.TimeZone class as well as the many uses of the DateTime.ToString() method. What I haven\'t been able to find is a way to convert a DateTime to a st

8条回答
  •  悲&欢浪女
    2020-12-08 19:27

    I would create a lookup table that converts time zone name to its abbreviation. If the match is not found you could return full zone name.

    See time zone abbreviations.

提交回复
热议问题