天青现在返回&QUOT无效值;协调世界时"对于TimeZoneInfo.Local.Id代替" UTC"?为什么? [英] Azure now returns invalid value of "Coordinated Universal Time" for TimeZoneInfo.Local.Id instead of "UTC"? Why?

查看:164
本文介绍了天青现在返回&QUOT无效值;协调世界时"对于TimeZoneInfo.Local.Id代替" UTC"?为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这似乎起3月7日,在东南亚地区的Azure服务器有一个补丁应用,这改变.NET的TimeZoneInfo的行为。

It appears starting March 7 that Azure servers in the Southeast Asia region had a patch applied which changed the behavior of TimeZoneInfo in .NET.

我的设置协调世界时(UTC)本地机器上,然后运行以下code产量UTC:

Setting my local machine to "(UTC) Coordinated Universal Time", then running the following code yields "UTC":

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine(TimeZoneInfo.Local.Id);
            Console.ReadLine();
        }
    }
}

远程进入我们的Azure实例和运行此相同应用程序中的一个产生如下:

Remoting into one of our Azure instances and running this same application yields the following:

协调世界时

据<一href="http://msdn.microsoft.com/en-us/library/vstudio/system.timezoneinfo.id%28v=vs.100%29.aspx">.NET文档,这是应该由StandardName属性,不Id属性被返回的值。我们传递给TimeZoneInfo.FindSystemTimeZoneById()这个值,它失败,因为协调世界时不是一个有效的ID(UTC是)。该时区中只有3个,其StandardName属性没有ID属性相匹配。一个

According to .NET documentation, this is the value that should be returned by the StandardName property, not the Id property. We pass this value in to TimeZoneInfo.FindSystemTimeZoneById(), and it fails since "Coordinated Universal Time" is not a valid Id ("UTC" is). This timezone is one of only 3 whose StandardName property does not match the Id property.

此前3月7日的Azure实例总是返回UTC的应有的价值。我们已经很难codeDUTC暂且作为权宜之计。

Prior to March 7, Azure instances always returned the proper value of "UTC". We have hardcoded "UTC" for the time being as a stopgap solution.

没有任何人有任何想法,为什么这样改是这样,什么是正确的长期的解决方案来处理这种情况?

Does anybody have any idea why this changed to be this way, and what is the proper long-term solution to handle this situation?

推荐答案

目前,在Windows Azure中的时区是太平洋标准时间(PST)。他们迁移到协调世界时(UTC)。这是一个潜在的重大更改为依赖于本地时间的​​应用程序。

Currently, the time zone within Windows Azure is Pacific Standard Time (PST). They have migrated to Coordinated Universal Time (UTC). This is potentially a breaking change for applications which rely on local time.

为什么我们要这么做?

Windows Azure的是一个全球性的服务。为了确保应用程序的运行它们的物理位置以相同的方式不管,这是非常重要的Windows Azure中具有在所有地区一致的时区。 UTC是考虑到全球客户群的必然选择,而UTC是不受日光节约时间(和缺陷相关的风险)。

Windows Azure is a global service. To ensure that applications behave the same way regardless of their physical location, it’s important that Windows Azure have a consistent time zone across all geographies. UTC is a natural choice given the global customer base, and UTC is not subject to Daylight Saving Time (and the associated risk of bugs).

什么是你的潜在影响?

如果您的应用程序在Windows Azure中运行依赖于本地时间,你会被迁移到UTC的影响。这里有潜在问题的几个例子:

If your application running in Windows Azure relies on local time, you will be impacted by the migration to UTC. Here are a few examples of potential issues:

如果本地时间戳用于间隙可能发生的事件日志中。 依赖于本地时间戳的用户界面可能会显示不同的结果。 您的应用程序存储本地时间戳可能是转换后PTED不同跨$ P $。 许多应用程序已经被设计为只依靠UTC时间。这些应用程序应该不会受到影响。

Gaps may occur in event logs if local timestamps are used. User interfaces that depend on local timestamps may show different results. Local timestamps stored by your application may be interpreted differently after the changeover. Many applications have already been designed to rely only on UTC time. These applications should be unaffected.

如果你希望他们改回去或者,如果您有任何其他问题,你可以把它与他们在下面的博客链接::

If you want them to change it back or if you have any other issues, you can take it up with them on the following blog link ::

Windows Azure的博客

这篇关于天青现在返回&QUOT无效值;协调世界时&QUOT;对于TimeZoneInfo.Local.Id代替&QUOT; UTC&QUOT;?为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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