[Mono-bugs] [Bug 54033][Wis] New - DateTime.Parse accepts invalid date string on Windows

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 8 Feb 2004 06:08:03 -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 gert.driesen@pandora.be.


--- shadow/54033	2004-02-08 06:08:03.000000000 -0500
+++ shadow/54033.tmp.7119	2004-02-08 06:08:03.000000000 -0500
@@ -0,0 +1,30 @@
+Bug#: 54033
+Product: Mono/Class Libraries
+Version: unspecified
+OS: other
+OS Details: Windows Server 2003
+Status: NEW   
+Priority: Wishlist
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: gert.driesen@pandora.be               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+Summary: DateTime.Parse accepts invalid date string on Windows
+On Windows, DateTime.Parse accepts an invalid date string :
+DateTime.Parse("15/01/2004", CultureInfo.InvariantCulture);
+should throw a FormatException as the given date string should be
+interpreted as MM/dd/yyyy and there's no 15th month.
+but instead Mono converted it to a time specification
+8/02/04 15:01:20  (result of DateTime.ToString())
+On Linux, the behaviour is correct and a FormatException is indeed thrown.