How do I format DateTime or TimeZone/TimeZoneInfo to display Three letters?

前端 未结 3 492
半阙折子戏
半阙折子戏 2021-01-14 23:21

I\'m working with a spec that calls for a peculiar Datetime format that I haven\'t necessarily had to work with yet.

At Process time, an OFX (1 not 2) datetime must

3条回答
  •  余生分开走
    2021-01-14 23:36

    The three-letter time zone codes are not unique across countries and are not completely standardized. For example, "CST" can be the abbreviation for "Central Standard Time (USA)" or "Chinese Standard Time". Which is correct depends on your locale.

    To my knowledge, there is no functionality built into the .NET Framework to look up codes like this, so you will need to implement it yourself.

    Additionally (but you probably know this), you need to be careful about how you implement this functionality. There is not necessarily a one-to-one correspondence between UTC offsets and time zone codes. For example, UTC-0700 could be either US Mountain Standard Time (MST) or US Pacific Daylight Time (PDT).

提交回复
热议问题