[Mono-bugs] [Bug 49358][Nor] Changed - DateTime.Parse ("12:01 PM").ToString ("h:mm tt") == "0:01 PM"

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 5 Oct 2003 22:48:23 -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 bmaurer@users.sf.net.

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

--- shadow/49358	2003-10-05 21:00:52.000000000 -0400
+++ shadow/49358.tmp.24399	2003-10-05 22:48:23.000000000 -0400
@@ -1,17 +1,17 @@
 Bug#: 49358
 Product: Mono/Class Libraries
 Version: unspecified
-OS: 
+OS: unknown
 OS Details: 
 Status: NEW   
 Resolution: 
-Severity: 
+Severity: Unknown
 Priority: Normal
 Component: CORLIB
-AssignedTo: mono-bugs@ximian.com                            
+AssignedTo: bmaurer@users.sf.net                            
 ReportedBy: bmaurer@users.sf.net               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
 URL: 
 Cc: 
 Summary: DateTime.Parse ("12:01 PM").ToString ("h:mm tt") == "0:01 PM"
@@ -42,6 +42,41 @@
 "h: Displays the hour for the specified DateTime object in the range 1-12.
 The hour represents whole hours passed since either midnight ( displayed as
 12 ) or noon ( also displayed as 12 ). If this format is used alone, then
 the same hour before or after noon is indistinguishable. If the hour is a
 single digit ( 1-9 ) , it is displayed as a single digit. No rounding
 occurs when displaying the hour. For example, a DateTime of 5:43 returns 5."
+
+------- Additional Comments From bmaurer@users.sf.net  2003-10-05 22:48 -------
+<miguel> Ben: ok, DateTime.ToString will require massive fixing
+<benHW> why?
+<miguel> Broken by design ;-(
+<miguel> Duncan had already warned me about it
+<benHW> sigh
+<benHW> i will rewrite it then
+<benHW> we are not having a bug in datetime
+<benHW> miguel: do you have details from duncan about why it is so broken
+<benHW> miguel: and if duncan finds any more broken core classes, have
+him tell me
+<miguel> ben: the state machine that parses the string is just broken code
+<miguel> broken, broken
+<miguel> It guesses by "parsing ahead"
+<miguel> it should really be done differently
+<miguel> accumulate options until a non-option is found
+<miguel> then render
+<miguel> ie, "dd MMM"
+<miguel> should accumulate dd, and when ' ' is found, render
+<miguel> then accumulate MMM, then when end-of-string is found, render
+<benHW> ok
+<benHW> well, you also have to handle ddMMM
+<miguel> Ah, right
+<miguel> So it has to have a flag `char accumulating_type'
+<miguel> if (accumulating_type != s [pos]) render (accumulated) else
+accumulated += s [pos]
+<benHW> yep,
+<benHW> or, we could just have a method:
+<benHW> static int ParseMultiple (string s, int pos)
+<benHW> and it would read untill it found a non-repeat char
+<miguel> something like that, yes
+<benHW> ok, so this doesnt sound too hard
+
+Am going to rewrite the method.