[Mono-bugs] [Bug 53025][Maj] New - DateTime ParseExact brokenly uses 2 digits of 4 digit year

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 18 Jan 2004 10:44:38 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by dave-mono@earth.li.

http://bugzilla.ximian.com/show_bug.cgi?id=53025

--- shadow/53025	2004-01-18 10:44:38.000000000 -0500
+++ shadow/53025.tmp.31660	2004-01-18 10:44:38.000000000 -0500
@@ -0,0 +1,50 @@
+Bug#: 53025
+Product: Mono/Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: dave-mono@earth.li               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: DateTime ParseExact brokenly uses 2 digits of 4 digit year
+
+Description of Problem:
+
+ParseExact, when given a pattern with a 2 year date will take the first 2
+digits of a 4 year date it is parsing, rather than reject it.
+
+Steps to reproduce the problem:
+1. Compile :
+
+using System;
+
+class t1
+{
+  static void Main(string [] args ) {
+    DateTime dt = DateTime.ParseExact("01/01/2002", "d/M/yy", null);
+    Console.WriteLine(dt);
+  }
+}
+
+2. Run 
+
+
+Actual Results:
+
+01/01/2020 00:00:00
+
+
+Expected Results:
+
+Unhandled Exception: System.FormatException: String was not recognized as a
+valid DateTime.
+
+Additional Information: