为什么当我设置 CurrentCulture 时时区没有改变?
根据我的研究,不可能更改线程的时区。所以我的问题是为什么你不能?
我本以为将应用程序的文化切换到特定国家/地区也会改变这一点,在我看来似乎是预期的行为。
编辑
修改后,我可以明白为什么它可能不应该默认映射为 1:1 的原因。然而,我仍然认为能够更改每个线程的时区将是一个很好的功能。
From what I have researched it is not possible to change the Timezone of a thread. So my question is why can't you?
I would have thought switching your application's culture to a specific country would also switch this, seems like expected behaviour IMO.
Edit
After revising I can see the reason why it probably shouldn't be mapped 1:1 by default. However, I still feel it would be a nice feature to be able to change the Timezone per thread.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
他们不是一对一的,所以他们没有真正的联系。如果将当前区域性设置为
en-US
,那是哪个时区? :)一些国家/地区有多个时区,因此设置文化(这也不是特定于国家/地区的这很重要),与时区没有太大关系。
They aren't a 1:1 so they're not really connected. If you set the current culture to
en-US
, which timezone is that? :)Several countries have more than 1 timezone, so setting the culture (which is not country specific either for that matter), doesn't really have much to do with the timzone.
文化是一回事,时区是另一回事。假设您是在美国纽约工作的南非公民。显然,您希望您的时区为 EST (GMT -5),因为那是您所在的位置;然而,根据您的建议,如果您也将您的文化设置为“af-ZA”,正如您可能想要的那样,这样做会自动将您的时区更改为 GMT +2。
Culture is one thing, time zone is another. Suppose you're a South African citizen working in New York, USA. Obviously you want your time zone to be EST (GMT -5), since that's where you are; from what you're suggesting, however, then if you also set your culture to "af-ZA," as you might want to, doing so would automatically change your time zone to GMT +2.