[Mono-bugs] [Bug 54721][Blo] New - Convert.ChangeType() fails with datetime format MM-DD-YYYY for InvariantCulture
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Sun, 22 Feb 2004 12:05:22 -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 jaak@zd.com.pl.
http://bugzilla.ximian.com/show_bug.cgi?id=54721
--- shadow/54721 2004-02-22 12:05:22.000000000 -0500
+++ shadow/54721.tmp.11205 2004-02-22 12:05:22.000000000 -0500
@@ -0,0 +1,37 @@
+Bug#: 54721
+Product: Mono/Class Libraries
+Version: unspecified
+OS: Fedora 1.0
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Blocker
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: jaak@zd.com.pl
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Convert.ChangeType() fails with datetime format MM-DD-YYYY for InvariantCulture
+
+DateTime dt = (DateTime)Convert.ChangeType(..., typeof(DateTime),
+CultureInfo.InvariantCulture);
+
+doesn't accept the date format "MM-DD-YYYY". "MM/DD/YYYY" is supported,
+though.
+
+NAnt relies on the former format being available, so this is a blocker.
+
+Attached test program on .NET prints:
+
+01-01-2000 converted as 2000-01-01 00:00:00
+12-31-2000 converted as 2000-12-31 00:00:00
+01/01/2000 converted as 2000-01-01 00:00:00
+
+on Mono-CVS/Fedora 1.0 it prints:
+
+ERROR converting 01-01-2000 to datetime: Invalid format
+ERROR converting 12-31-2000 to datetime: Invalid format
+01/01/2000 converted as Saturday, 01 January 2000 00:00:00