Bug 621408

Summary: TimeZoneInfo.FindSystemTimeZoneById(TimeZoneInfo.Local.Id) throws a TimeZoneNotFoundException
Product: [Mono] Mono: Class Libraries Reporter: Daniel Sell <dredd422>
Component: Sys.CoreAssignee: Mono Bugs <mono-bugs>
Status: NEW --- QA Contact: Mono Bugs <mono-bugs>
Severity: Normal    
Priority: P5 - None    
Version: 2.6.x   
Target Milestone: ---   
Hardware: i686   
OS: openSUSE 11.2   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Daniel Sell 2010-07-10 08:14:58 UTC
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.99 Safari/533.4

When trying to find a TimeZoneInfo by Id, you can't use the local TimeZoneInfo's Id.

TimeZoneInfo.Local.Id results in "Local"

"Local" is not a valid Id for any TimeZoneInfo in TimeZoneInfo.GetSystemTimeZones()

Reproducible: Always

Steps to Reproduce:
1. $> csharp
2. TimeZoneInfo.FindSystemTimeZoneById(TimeZoneInfo.Local.Id);
Actual Results:  
System.TimeZoneNotFoundException: Exception of type 'System.TimeZoneNotFoundException' was thrown.
  at System.TimeZoneInfo.FindSystemTimeZoneByFileName (System.String id, System.String filepath) [0x00000] in <filename unknown>:0 
  at System.TimeZoneInfo.FindSystemTimeZoneById (System.String id) [0x00000] in <filename unknown>:0 
  at Class6.Host (System.Object& $retval) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Evaluator.Evaluate (System.String input, System.Object& result, System.Boolean& result_set) [0x00000] in <filename unknown>:0 
  at Mono.CSharpShell.Evaluate (System.String input) [0x00000] in <filename unknown>:0 


Expected Results:  
A TimeZoneInfo representing the current time zone should be returned.

$> mono --version
Mono JIT compiler version 2.6.7 (tarball Thu Jul  8 20:11:11 UTC 2010)
Copyright (C) 2002-2010 Novell, Inc and Contributors. www.mono-project.com
	TLS:           __thread
	GC:            Included Boehm (with typed GC and Parallel Mark)
	SIGSEGV:       altstack
	Notifications: epoll
	Architecture:  x86
	Disabled:      none
Comment 1 Daniel Sell 2010-07-10 08:20:29 UTC
I forgot to mention that I did try this on MS .NET and it worked as intended.