Hi All,
I'm having a bit of trouble with the GetUtcOffset method of
TimeZoneInfo.
The code below should return the corrent timezone offset in hours for
western Australia.. which at the moment is 8 hours. The code however
returns 9 hours and I cannot understand why.
Another interesting point is that IsDaylightSavingTime
(DateTime.UtcNow) returns true when it is daylight savings time is not
currently active in western Australia.
Any thoughts?
Thanks
Mike
TimeZoneInfo info = TimeZoneInfo.FindSystemTimeZoneById("W. Australia
Standard Time");
var hours = info.GetUtcOffset(DateTime.UtcNow).TotalHours;