I have code that works fine in an emulator, but on a 3gs device it crashes using a TimeZoneNotFoundException.
The reason for my code is to convert the server time (given in CET) to the local time zone.
var t = TimeZoneInfo.FindSystemTimeZoneById(TimeZone.CurrentTimeZone.StandardName);
double localOffset = t.GetUtcOffset(DateTime.Now).TotalMilliseconds;
The local time zone in my case is CET.
Any idea why this is not working in Monotouch? Is this a MonoTouch limitation? Since the code works in the emulator, I do not see that this is a programming error? I tried to rewrite this, but always end up with the same exception. Also tried "TimeZoneInfo.Local", but this immediately gives an error.
Any help is much appreciated!
source
share