[Mono-bugs] [Bug 73410][Maj] Changed - Convert.ToDateTime fails without a cultureinfo object

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 11 Apr 2005 08:13:59 -0400 (EDT)


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 atsushi@ximian.com.

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

--- shadow/73410	2005-03-07 07:20:21.000000000 -0500
+++ shadow/73410.tmp.8319	2005-04-11 08:13:59.000000000 -0400
@@ -45,6 +45,29 @@
 System.IFormatProvider format = new System.Globalization.CultureInfo("en-
 US", true);
 DateTime dateCrawled = Convert.ToDateTime(lastCrawled, format);
 
 ------- Additional Comments From vargaz@gmail.com  2005-03-07 07:20 -------
 -> corlib
+
+------- Additional Comments From atsushi@ximian.com  2005-04-11 08:13 -------
+This is Microsoft bug that incorrectly allows such date/time string
+whose pattern is not listed in GetAllDateTimePatterns() return value
+of corresponding DateTimeFormatInfo (say, InvariantInfo).
+
+Feel free to report this bug to Microsoft.
+
+using System;
+using System.Globalization;
+
+public class Test
+{
+        public static void Main ()
+        {
+                DateTime.Parse ("3/6/2005 6:58:26 PM",
+CultureInfo.InvariantCulture);
+                foreach (string s in
+CultureInfo.InvariantCulture.DateTimeFormat.GetAllDateTimePatterns ())
+                        Console.WriteLine (s);
+        }
+}
+