Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Currently, when I attempt any of the time conversion methods in System.TimeZoneInfo, such as System.TimeZoneInfo.ConvertTime() I receive the following error:
Details: System.TimeZoneNotFoundException: Exception of type 'System.TimeZoneNotFoundException' was thrown.
at System.TimeZoneInfo.get_Local () [0x00000] in <filename unknown>:0
at System.TimeZoneInfo.ConvertTime (DateTime dateTime, System.TimeZoneInfo destinationTimeZone) [0x00000] in <filename unknown>:0
The code works fine on the iOS simulator, but when placed on a device the code will not run and throws an error.
I have created a simplified example of the issue available at:
When you run this in the simulator you should see the text "Nothing has happened", however when you run this on an actual device you will get an TimeZoneNotFoundException in its place.
The existing code reads data from the OS, e.g. /etc/localtime
That might be available when running from the simulator (on a Mac) but not when executed on the device.
Until a fix is available have a look at NSTimeZone to see if you can make it do what you require.
I managed to create a work around to get my applications talking using the correct time :). I had a look at the mono source code and assumed the /etc/localtime to be the case - was unsure on how to fix it.
I know that the local time can be determined on iOS using NSTimeZone.localTimeZone which could put you somewhere towards a fix :)
downgrading to 'major' since a workaround is possible
Fixed (for 5.1). We now initialize the BCL TimeZoneInfo from NSTimeZone since we cannot, when executed on devices, access the file system to get directly the required files.