When using TimeZoneInfo.Local.Id on MonoTouch, I get CET (for Central European Time). On ASP.NET, I get Central Europe Standard Time.
I need to transfer the time zone from the iOS device (MonoTouch) to my ASP.NET web service. It is not sufficient to just transfer the time zone difference (UTC +1), since this does not respect the country-specific Daylight Saving Time settings.
What’s the best way to get the iPhone’s time zone to my web service?
There’s more than one data source for time zones inside MonoTouch.
One comes from the .NET base class library (BCL),
System.TimeZoneInfoand it’s meant to be compatible (it’s structure, not the data) with Microsoft .NET implementation. It has two disadvantages.it’s not 100% compatible with MS data (different data source were used);
it cannot be updated without re-building your application with an updated MonoTouch;
The other one is
MonoTouch.Foundation.NSTimeZonewhich are bindings to iOS API. The API is a bit different but the data it returns match what other iOS applications will uses and it will be updated (with iOS updates).IMO
MonoTouch.Foundation.NSTimeZoneis better suited for the reasons above.As for your offset to UTC you can get the daylight specific offset (in seconds) with: