[Mono-bugs] [Bug 49358][Nor] New - 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 21:00:52 -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.23764	2003-10-05 21:00:52.000000000 -0400
@@ -0,0 +1,47 @@
+Bug#: 49358
+Product: Mono/Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+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"
+
+Description of Problem:
+The MSDN docs state that the "h" formatting string gives a number [1, 12],
+but we give [0, 11]
+
+Steps to reproduce the problem:
+using System;
+class t{
+	static void Main () {
+		Console.WriteLine (DateTime.Parse ("12:01 PM").ToString ("h:mm tt"));
+	}
+}
+
+Actual Results:
+0:01 PM
+
+Expected Results:
+12:01 PM
+
+How often does this happen? 
+Always
+
+Additional Information:
+MSDN:
+"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."