Question

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.

Was it helpful?

Solution

The current time zone on the XP machine is "US Eastern Standard Time" while the current time zone on the Server machine is "US Eastern Daylight Time". The US changed from Standard to Daylight time on Sunday. Perhaps the XP machine needs to have its time zone information updated.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top