Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
印第安纳州的.NET TimeZoneInfo对象显示他们观察DST?_.net_Vb.net - Fatal编程技术网

印第安纳州的.NET TimeZoneInfo对象显示他们观察DST?

印第安纳州的.NET TimeZoneInfo对象显示他们观察DST?,.net,vb.net,.net,Vb.net,为什么.NET中的TimeZoneInfo类会显示印第安纳遵守夏令时?我想印第安纳州的那些地方一直都是最美的。我是否应该用“美国东部标准时间”以外的东西来代表印第安纳州那些不遵守DST的地区 Dim timeZones As New List(Of String)() With timeZones .Add("Eastern Standard Time") ' Eastern TZ, except parts of Indiana .Add("US Eastern Stand

为什么.NET中的TimeZoneInfo类会显示印第安纳遵守夏令时?我想印第安纳州的那些地方一直都是最美的。我是否应该用“美国东部标准时间”以外的东西来代表印第安纳州那些不遵守DST的地区

Dim timeZones As New List(Of String)()
With timeZones
    .Add("Eastern Standard Time")   ' Eastern TZ, except parts of Indiana
    .Add("US Eastern Standard Time")    ' parts of Indiana?
End With

For Each tz In timeZones
    Dim tzi As TimeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById(tz)
    buf.AppendLine(tz)
    buf.AppendFormat("SupportsDaylightSavingTime: {0}", tzi.SupportsDaylightSavingTime).AppendLine()
    buf.AppendFormat("DisplayName: {0}", tzi.DisplayName).AppendLine()
    buf.AppendFormat("StandardName: {0}", tzi.StandardName).AppendLine()
    buf.AppendFormat("DaylightName: {0}", tzi.DaylightName).AppendLine()
    buf.AppendFormat("IsDaylightSavingTime: {0}", tzi.IsDaylightSavingTime(DateTime.Now)).AppendLine()
    buf.AppendFormat("Current Local Time: {0}", TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, tzi)).AppendLine()
    buf.AppendFormat("Current UTC Time: {0}", DateTime.UtcNow).AppendLine()
    buf.AppendLine()
Next
结果:

Eastern Standard Time
SupportsDaylightSavingTime: True
DisplayName: (UTC-05:00) Eastern Time (US & Canada)
StandardName: Eastern Standard Time
DaylightName: Eastern Daylight Time
IsDaylightSavingTime: True
Current Local Time: 4/26/2012 10:37:08 AM
Current UTC Time: 4/26/2012 2:37:08 PM

US Eastern Standard Time
SupportsDaylightSavingTime: True
DisplayName: (UTC-05:00) Indiana (East)
StandardName: US Eastern Standard Time
DaylightName: US Eastern Daylight Time
IsDaylightSavingTime: True
Current Local Time: 4/26/2012 10:37:08 AM
Current UTC Time: 4/26/2012 2:37:08 PM
根据和的说法,整个印第安纳州现在都在观察DST——但不是在中部时间就是在东部时间

所以印第安纳州没有“一次”,但它在任何地方都观察到某种形式的夏令时。如果你回到2005年之前(我对上面的页面不是很清楚),你可能会发现或者不会发现Windows时区数据库正确地模拟了历史。我希望他们能得到更全面的信息。。。它有几个不同的印第安纳州时区ID(如美洲/印第安纳州/诺克斯、美洲/印第安纳州/彼得堡等)

根据和,整个印第安纳州现在都遵守DST,但在中部或东部时间


所以印第安纳州没有“一次”,但它在任何地方都观察到某种形式的夏令时。如果你回到2005年之前(我对上面的页面不是很清楚),你可能会发现或者不会发现Windows时区数据库正确地模拟了历史。我希望他们能得到更全面的信息。。。它有几个不同的基于印第安纳州的时区ID(例如,America/Indiana/Knox、America/Indiana/Petersburg等)

谢谢Jon!所以答案基本上是“美国东部标准时间”是印第安纳州过去不做DST的部分的正确时区id,2005年改变了,他们现在做DST,我只是没有收到备忘录。@mattmc3:嗯,也许吧。这取决于他们中是否有人现在是中央时间。这很复杂,显然:)好吧,我是按邮政编码而不是州来划分时区的(这也不是很准确,但对我来说已经足够了),所以有很多州(12个)有双时区,所以我得到了印第安纳州的CST,但我关心的是夏令时。是的,这太复杂了,我只是在处理美国时区的问题。谢谢乔恩!所以答案基本上是“美国东部标准时间”是印第安纳州过去不做DST的部分的正确时区id,2005年改变了,他们现在做DST,我只是没有收到备忘录。@mattmc3:嗯,也许吧。这取决于他们中是否有人现在是中央时间。这很复杂,显然:)好吧,我是按邮政编码而不是州来划分时区的(这也不是很准确,但对我来说已经足够了),所以有很多州(12个)有双时区,所以我得到了印第安纳州的CST,但我关心的是夏令时。是的,这太复杂了,我只是在处理美国时区的问题。