[Mono-bugs] [Bug 24991] New - Hour not correct converting to String

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
20 May 2002 17:42:34 -0000


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 danmorg@sc.rr.com.

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

--- shadow/24991	Mon May 20 13:42:34 2002
+++ shadow/24991.tmp.30661	Mon May 20 13:42:34 2002
@@ -0,0 +1,48 @@
+Bug#: 24991
+Product: Mono/Class Libraries
+Version: unspecified
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Minor
+Component: System
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: danmorg@sc.rr.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Hour not correct converting to String
+
+Description of Problem:
+I am trying to use the Hour from a DateTime in a problem.  However,
+it shows up as 56 instead of 8.  It maybe a problem with the conversion
+of data types.
+
+Steps to reproduce the problem:
+1. See the code below 
+
+Actual Results:
+56
+
+Expected Results:
+8
+
+How often does this happen? 
+Consistently.
+
+Additional Information:
+
+I have an excerpt of the C# code here:
+
+// YYYY,MM,DD, hh,mi,ss, ms
+DateTime dt = new DateTime(2000,12,31, 08,30,45, 22);
+
+StringBuilder sb = new StringBuilder();
+Console.WriteLine("Hour from DateTime: " + dt.Hour); // result: 8
+
+const char zero = '0'; // zero
+sb.Append(zero + dt.Hour);
+Console.WriteLine("Hour from StringBuilder: " + sb); // result: 56