I have a function that, among other things, does the conversion from Utc to Local and vice versa. The problem is that when I run it on a PC with Win 7, it works fine, but when I run it on a PC with Vista, the conversion goes wrong.
ex: My current time zone is +2 UTC
MyCurrentTime is set on 09/27/2012, 7:00 p.m., but DateTimeKind is not specified.
DateTime utcTime = DateTime.SpecifyKind(MyCurrentTime,DateTimeKind.Utc);
DateTime localTime = new DateTime();
localTime = utcTime.Date.ToLocalTime();
Exit to Win 7 - 09/27/2012, 5:00 p.m.
Exit to Vista - 09/27/2012, 04:00 a.m.
Any ideas why this is happening?
Thank.
source
share