看起来 .NET 中有两个区域(至少在我的 Windows 8 安装中)是山区时间。
您正在使用“美国山地标准时间”,但它不遵守 DST(它适用于亚利桑那州)——而普通的“山地标准时间”确实遵守 DST。所以你只需要摆脱“美国”部分,它就会起作用:
using System;
class Test
{
static void Main()
{
DateTime octoberUtc = new DateTime(2012, 10, 1, 0, 0, 0, DateTimeKind.Utc);
DateTime decemberUtc = new DateTime(2012, 12, 1, 0, 0, 0, DateTimeKind.Utc);
ConvertToMountainTime(octoberUtc);
ConvertToMountainTime(decemberUtc);
}
static void ConvertToMountainTime(DateTime utc)
{
DateTime mountain = TimeZoneInfo.ConvertTimeBySystemTimeZoneId
(utc, "Mountain Standard Time");
Console.WriteLine("{0} (UTC) = {1} Mountain time", utc, mountain);
}
}
输出(英国文化):
01/10/2012 00:00:00 (UTC) = 30/09/2012 18:00:00 Mountain time
01/12/2012 00:00:00 (UTC) = 30/11/2012 17:00:00 Mountain time