[Mono-bugs] [Bug 47753][Nor] Changed - DateTime.ToString() produces different output on Mono versus .NET
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Fri, 21 Nov 2003 14:35:01 -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 kem@leoninedev.com.
http://bugzilla.ximian.com/show_bug.cgi?id=47753
--- shadow/47753 2003-08-20 06:33:38.000000000 -0400
+++ shadow/47753.tmp.1545 2003-11-21 14:35:01.000000000 -0500
@@ -1,10 +1,10 @@
Bug#: 47753
Product: Mono/Class Libraries
Version: unspecified
-OS: unknown
+OS: Suse 8.2
OS Details:
Status: NEW
Resolution:
Severity: Unknown
Priority: Normal
Component: CORLIB
@@ -82,6 +82,31 @@
Console.WriteLine(d.ToString("HH:mm:ss", null));
}
}
------- Additional Comments From gonzalo@ximian.com 2003-08-20 06:33 -------
See also bug 47720
+
+------- Additional Comments From kem@leoninedev.com 2003-11-21 14:35 -------
+The problem is with the 'h' formatter used in the ToString() method.
+In MS .NET, the ToString("h:mm:ss tt") for 12:00am return "12:00:00
+AM" where as Mono returns "0:00:00 AM".
+
+The question is where does the class library determine where 12:00 AM
+is 00:00 or 12:00?
+
+Example program:
+
+using System;
+namespace Test1
+{
+ class Class1
+ {
+ static void Main(string [] args)
+ {
+ DateTime dt;
+ dt = DateTime.Parse("11/12/2003 00:00");
+ Console.WriteLine("Now: " + dt.ToString("h:mm:ss tt"));
+ }
+ }
+}
+