[Mono-bugs] [Bug 60912][Nor] Changed - DateTime.Parse() does not support pattern "6/28/2004 12:00:00 AM"

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 30 Jun 2004 00:32:14 -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=60912

--- shadow/60912	2004-06-29 21:05:24.000000000 -0400
+++ shadow/60912.tmp.10172	2004-06-30 00:32:14.000000000 -0400
@@ -2,13 +2,13 @@
 Product: Mono: Class Libraries
 Version: unspecified
 OS: All
 OS Details: 
 Status: NEW   
 Resolution: 
-Severity: 
+Severity: Unknown
 Priority: Normal
 Component: CORLIB
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: rshade@dvsconsulting.com               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
@@ -19,6 +19,44 @@
 DateTime.Parse() does not support pattern "6/28/2004 12:00:00 AM"
 
 ------- Additional Comments From rshade@dvsconsulting.com  2004-06-29 21:05 -------
 Created an attachment (id=8399)
 TestCase
 
+
+------- Additional Comments From atsushi@ximian.com  2004-06-30 00:32 -------
+It is culture dependent and what we do not fully support right now.
+What is your culture? (CultureInfo.CurrentCulture)
+
+Below is the short program with which I always verify if the date
+string is universally parsable or not:
+
+using System;
+using System.Threading;
+using System.Globalization;
+class Test
+{
+        public static void Main (string [] rgszArgs)
+        {
+                for (int i = 0; i < 32768; i++) {
+                        CultureInfo ci;
+                        try {
+                                ci = new CultureInfo (i);
+                                if (ci.IsNeutralCulture)
+                                        continue;
+                        } catch (Exception) {
+                                continue;
+                        }
+                        Thread.CurrentThread.CurrentCulture =&#12288;ci;
+                        DateTime dt;
+                        try {
+                                dt = DateTime.Parse ("6/28/2004
+12:00:00 AM");
+                        } catch (Exception ex) {
+                                Console.WriteLine ("culture&#12288;{0} {1}
+failed: {2} {3} {4}", i, ci, ci.Calendar,
+ci.DateTimeFormat.PMDesignator, ex.Message);
+                        }
+                }
+        }
+}
+