当我为dt的这个特定值运行代码时,当我调用ConvertTimeToUtc方法时会抛出异常.我的本地机器timeZoneId是"GMT标准时间"
var tzi = TimeZoneInfo.FindSystemTimeZoneById("Central Standard Time");
var dt = new DateTime(1995, 4, 2, 2, 55, 0);
var t = TimeZoneInfo.ConvertTimeToUtc(dt, tzi);
Run Code Online (Sandbox Code Playgroud)
例外是:
System.ArgumentException was unhandled
Message="The supplied DateTime represents an invalid time. For example, when the clock is adjusted forward, any time in the period that is skipped is invalid.\r\nParameter
Run Code Online (Sandbox Code Playgroud)