Bug 11264 - TimeZoneNotFoundException calling TimeZoneInfo.Local.GetUtcOffset(dateTime)
Summary: TimeZoneNotFoundException calling TimeZoneInfo.Local.GetUtcOffset(dateTime)
Status: RESOLVED DUPLICATE of bug 11817
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Core (show other bugs)
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2013-03-19 11:39 UTC by DesDesDes
Modified: 2018-03-13 14:02 UTC (History)
5 users (show)

See Also:
Is this bug a regression?: ---
Last known good build:

System.TimeZoneNotFoundException (1.12 KB, patch)
2016-08-04 22:57 UTC, rekaheno
Details | Diff

Description DesDesDes 2013-03-19 11:39:54 UTC
Repro on Windows 7 using mono 3.0.6.

Following test fails on Windows 7 using mono 3.0.6, but succeeds using MS.NET 3.5

public class Test
	public void TestCase ()
		var d = new DateTime(2013, 12, 1);
		var offset = TimeZoneInfo.Local.GetUtcOffset(d);
		var baseOffset = TimeZoneInfo.Local.BaseUtcOffset;
		Assert.AreEqual(baseOffset, offset);

System.TimeZoneNotFoundException : Exception of type 'System.TimeZoneNotFoundException' was thrown.
  at System.TimeZoneInfo.get_Local () [0x00000] in <filename unknown>:0
  at Test.Test.TestCase () [0x00000] in <filename unknown>:0
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0

This also prevents the commonly used Newtonsoft.Json library from serializing DateTime values to .net objects.
Comment 1 Andrey 2013-04-17 05:49:39 UTC
Looks like the same as https://bugzilla.xamarin.com/show_bug.cgi?id=11817
Comment 2 rekaheno 2016-08-04 22:57:40 UTC
Created attachment 16908 [details]
Comment 3 Marek Safar 2018-03-13 14:02:22 UTC

*** This bug has been marked as a duplicate of bug 11817 ***

Note You need to log in before you can comment on or make changes to this bug.