I am working with the Exchange Managed API on SharePoint and in order to correctly get date/time information from the Exchange Managed API I need to pass it a TimeZoneInfo object when initializing the ExchangeService object. I would like to get the time zone in this order: 1) by the user profile, if null then 2) the default time zone of the current web application, if null then 3) the time zone of the server.
I am able to get the time zone of the server with TimeZoneInfo.Local, however the time zone of the user profile and the web application return as an SPTimeZone object.
The SPTimeZone object also has an SPTimeZoneInformation property (SPTimeZone.Information).
Does anyone have a method where I can convert an SPTimeZone (or SPTimeZoneInformation) object into a TimeZoneInfo object?