2017 年巴西夏令时开始时间不正确
Incorrect DST start for Brazil in 2017
2017 年夏令时在巴西开始于 10 月 15 日 00:00:00(午夜)- details
当我在 Windows 更改为巴西时区并将日期更改为 2017 年 10 月 15 日之前的几天时,我看到系统正确显示 DST 开始日期(显示 DST 将开始的信息10 月 15 日)。
问题是当我尝试从代码中获取 DST 开始日期时 returns 10 月 22 日。我尝试使用 c++ mktime 和 c# TimeZone.GetDaylightChanges.
这是 C# 代码:
Console.WriteLine(TimeZone.CurrentTimeZone.GetDaylightChanges(2017).Start.ToString());
结果是:
10/21/2017 11:59:59 PM
知道为什么吗?
TimeZone
class只支持一种调整,可能会出错,见https://msdn.microsoft.com/en-us/library/system.timezone.getdaylightchanges(v=vs.110).aspx。
这是来电者须知它推荐
a more accurate result is available by working with the array of TimeZoneInfo.AdjustmentRule objects returned by the TimeZoneInfo.GetAdjustmentRules method. The Start, End, and Delta properties correspond to the TimeZoneInfo.AdjustmentRule.DateStart, TimeZoneInfo.AdjustmentRule.DateEnd, and TimeZoneInfo.AdjustmentRule.DaylightDelta properties.
2017 年夏令时在巴西开始于 10 月 15 日 00:00:00(午夜)- details
当我在 Windows 更改为巴西时区并将日期更改为 2017 年 10 月 15 日之前的几天时,我看到系统正确显示 DST 开始日期(显示 DST 将开始的信息10 月 15 日)。
问题是当我尝试从代码中获取 DST 开始日期时 returns 10 月 22 日。我尝试使用 c++ mktime 和 c# TimeZone.GetDaylightChanges.
这是 C# 代码:
Console.WriteLine(TimeZone.CurrentTimeZone.GetDaylightChanges(2017).Start.ToString());
结果是:
10/21/2017 11:59:59 PM
知道为什么吗?
TimeZone
class只支持一种调整,可能会出错,见https://msdn.microsoft.com/en-us/library/system.timezone.getdaylightchanges(v=vs.110).aspx。
这是来电者须知它推荐
a more accurate result is available by working with the array of TimeZoneInfo.AdjustmentRule objects returned by the TimeZoneInfo.GetAdjustmentRules method. The Start, End, and Delta properties correspond to the TimeZoneInfo.AdjustmentRule.DateStart, TimeZoneInfo.AdjustmentRule.DateEnd, and TimeZoneInfo.AdjustmentRule.DaylightDelta properties.