C#英国夏令时(BST)时区的缩写 [英] C# british summer time (BST) timezone abbreviation

查看:704
本文介绍了C#英国夏令时(BST)时区的缩写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要显示当前时区缩写标签。我的电脑的时区当前设置为(GMT)格林威治时间:都柏林,爱丁堡,里斯本,伦敦。这样一来,我想看看BST显示,由于LN目前在英国夏令时间。

I need to display a label with the current time zone abbreviation. My pc's timezone is currently set to "(GMT) Greenwich Mean Time : Dublin, Edinburgh, Lisbon, London". As a result, I would like to see BST displayed, since LN is currently in british summer time.

它看起来像该信息(时区缩写)不可用。纵观GMT的TimeZoneInfo,我只能就名看到的是

It looks like that info (timezone abbrev) is not available. Looking at the GMT TimeZoneInfo, all I can see with regard to names is

Id  "GMT Standard Time"
StandardName    "GMT Standard Time"
DaylightName    "GMT Daylight Time"

有没有什么办法让从GMT夏令时BST或其他任何可用的Windows时区信息?

Is there any way to get to BST from "GMT Daylight Time" or any other available Windows timezone info?

推荐答案

的TimeZoneInfo 类引荐英国夏令时为GMT夏令时,所以没有它不可能。如果微软将其保存为BST这将是在 DaylightName 属性。

The TimeZoneInfo class referrers to "British Summer Time" as "GMT Daylight Time", so no it is not possible. If Microsoft were to store it as "BST" it would be in the DaylightName property.

虽然很多年前后的的TimeZoneInfo 类的BCL博客的发展,我看到后面,他们是如何选择的值 DaylightName没有解释。如果我想这肯定是因为这是一个时间区,而不是一个特殊的城市。

Whilst following the development of the TimeZoneInfo class on the BCL blog many years ago, I saw no explanation behind how they chose the values for DaylightName. If I were to guess it would be because this is for a "Time Zone" and not a particular city.

看来,公共领域的 tzdatabase ,这被认为是比微软的时区数据库更加完整,不显示BST伦敦(的来源)。这是因为城市都包含在该数据集中,而不仅仅是时区。 有一个名为野田佳彦时间计划,带来了tzdatabase到.NET,现在是avaialble。

It appears that the public-domain tzdatabase, which is considered to be more complete than Microsoft's time zone database, does display BST for London (source). This is because Cities are included in this dataset, not just the Time Zones. There is a Project called Noda Time that brings the tzdatabase to .Net that is now avaialble.

这篇关于C#英国夏令时(BST)时区的缩写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆