0

From yesterday (the first day of US day light saving adjustment had began.) the same code that runs on two different computers are giving different results. Here are the code:

DateTime t = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(
          DateTime.UtcNow, r.timeZone);

While timezone used here is "US Eastern Standard Time"

Input (DateTime.UtcNow) is 2012/03/13 19:10:00

On a windows XP SP3 machine the code returns: 2012/03/13 14:10:00

On a windows server 2008 machine the same code returns: 2012/03/13 15:10:00

This is not expected. Any thoughts?

Best.

4

1 回答 1

4

XP 机器上的当前时区是“美国东部标准时间”,而服务器机器上的当前时区是“美国东部夏令时间”。美国周日从标准时间改为夏令时间。也许 XP 机器需要更新其时区信息。

于 2012-03-13T19:34:11.650 回答