Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我有值:-5 表示时区 (GMT-5)。
如何将其转换为:“Central DST”或使用 C# 和 .NET 框架的类似文本?
谢谢!
使用 .NET 3.5,您可以使用 TimeZoneInfo.GetSystemTimeZones(),然后遍历直到使用 BaseUtcOffset 找到匹配项。
请注意,每个偏移量可能有多个条目,因此您的结果会有些随意。