[Mono-bugs] [Bug 72132][Min] New - Few additional date formats are not supported by System.DateTime structure.

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 2 Feb 2005 12:39:07 -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 radical@gmail.com.

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

--- shadow/72132	2005-02-02 12:39:07.000000000 -0500
+++ shadow/72132.tmp.3759	2005-02-02 12:39:07.000000000 -0500
@@ -0,0 +1,96 @@
+Bug#: 72132
+Product: Mono: Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Minor
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: radical@gmail.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Few additional date formats are not supported by System.DateTime structure.
+
+Description of Problem:
+
+Few additional date formats are not supported by System.DateTime structure.
+
+Steps to reproduce the problem:
+
+1. compile the program
+
+using System;
+
+public class MainClass
+{
+        public static void Main (string [] args)
+        {
+                try {
+                        Console.WriteLine (DateTime.Parse ("Monday, 25
+February 2002 05:25"));
+                } catch (Exception e) { Console.WriteLine ("#1 {0}", e); }
+
+                try {
+                        Console.WriteLine (DateTime.Parse ("Monday, 25
+February 2002 05:25:22"));
+                } catch (Exception e) { Console.WriteLine ("#2 {0}", e); }
+
+                try {
+                        Console.WriteLine (DateTime.Parse ("2004 January"));
+                } catch (Exception e) { Console.WriteLine ("#3 {0}", e); }
+        }
+}
+
+Actual Results:
+
+#1 System.FormatException: String was not recognized as a valid DateTime.
+in <0x00238> System.DateTime:Parse
+(string,System.IFormatProvider,System.Globalization.DateTimeStyles)
+in <0x00016> System.DateTime:Parse (string,System.IFormatProvider)
+in <0x00013> System.DateTime:Parse (string)
+in <0x00028> MainClass:Main (string[])
+
+#2 System.FormatException: String was not recognized as a valid DateTime.
+in <0x00238> System.DateTime:Parse
+(string,System.IFormatProvider,System.Globalization.DateTimeStyles)
+in <0x00016> System.DateTime:Parse (string,System.IFormatProvider)
+in <0x00013> System.DateTime:Parse (string)
+in <0x00098> MainClass:Main (string[])
+
+#3 System.FormatException: String was not recognized as a valid DateTime.
+in <0x00238> System.DateTime:Parse
+(string,System.IFormatProvider,System.Globalization.DateTime
+(string,System.IFormatProvider,System.Globalization.DateTimeStyles)
+in <0x00016> System.DateTime:Parse (string,System.IFormatProvider)
+in <0x00013> System.DateTime:Parse (string)
+in <0x00108> MainClass:Main (string[])
+
+Expected Results:
+2/25/2002 5:25:00 AM
+2/25/2002 5:25:22 AM
+1/1/2004 12:00:00 AM
+
+How often does this happen?
+always
+
+Additional Information:
+fix:
+Index: DateTime.cs
+===================================================================
+--- DateTime.cs (revision 39302)
++++ DateTime.cs (working copy)
+@@ -115,6 +115,9 @@     
+                        // DayOfTheWeek, dd full_month_name yyyy
+                        // FIXME: 1054(th-TH) rejects it
+                        "dddd, dd MMMM yyyy",
++                       "dddd, dd MMMM yyyy HH:mm",
++                       "dddd, dd MMMM yyyy HH:mm:ss",
++                       "yyyy MMMM",
+                        // DayOfTheWeek, dd yyyy. This works for every locales.
+                        "MMMM dd, yyyy",
+ #if NET_1_1