Bugzilla – Bug 622524
Calling TimeZoneInfo.Local throws TimeZoneNotFoundException
Last modified: 2010-11-27 00:55:25 UTC
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618; .NET4.0C; .NET4.0E) Any call to TimeZoneInfo.Local throws a TimeZoneNotFoundException Reproducible: Always Steps to Reproduce: 1. call TimeZoneInfo.Local Actual Results: Thrown 'System.TimeZoneNotFoundException'. Expected Results: The local TimeZoneInfo I tested with XSP 2.6.6. This is the simplest test: <%@ Page Language="C#" %> <%= TimeZoneInfo.Local == null %> The result: System.TimeZoneNotFoundException: Exception of type 'System.TimeZoneNotFoundException' was thrown. at System.TimeZoneInfo.get_Local () [0x00000] in <filename unknown>:0 at ASP.timezoneinfo_aspx.__RenderTree (System.Web.UI.HtmlTextWriter __output, System.Web.UI.Control parameterContainer) [0x00000] in <filename unknown>:0 at System.Web.UI.Control.RenderChildren (System.Web.UI.HtmlTextWriter writer) [0x00000] in <filename unknown>:0 at System.Web.UI.Control.Render (System.Web.UI.HtmlTextWriter writer) [0x00000] in <filename unknown>:0 at System.Web.UI.Page.Render (System.Web.UI.HtmlTextWriter writer) [0x00000] in <filename unknown>:0 at System.Web.UI.Control.RenderControl (System.Web.UI.HtmlTextWriter writer) [0x00000] in <filename unknown>:0 at System.Web.UI.Page.RenderPage () [0x00000] in <filename unknown>:0 at System.Web.UI.Page.InternalProcessRequest () [0x00000] in <filename unknown>:0 at System.Web.UI.Page.ProcessRequest (System.Web.HttpContext context) [0x00000] in <filename unknown>:0
This also affects IKVM.NET
I can confirm this on Windows 7 using mono 2.8.1. the following program fails with different timezones: using System; namespace TimeZoneTests { class MainClass { public static void Main (string[] args) { Console.WriteLine (TimeZoneInfo.Local); } } } I tested it with "(UTC -06:00) Central" "+1 Berlin Bern ..." and some other timezones. if I use the mono Runtime in Monodevelop the above program fails. if I use the Microsoft .Net Runtime it works as expected.