[Mono-bugs] [Bug 36518][Wis] New - System.DateTime.ToLocalTime returns UTC time
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
Thu, 9 Jan 2003 10:37:12 -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 kelk1@hotmail.com.
http://bugzilla.ximian.com/show_bug.cgi?id=36518
--- shadow/36518 Thu Jan 9 10:37:12 2003
+++ shadow/36518.tmp.19788 Thu Jan 9 10:37:12 2003
@@ -0,0 +1,63 @@
+Bug#: 36518
+Product: Mono/Class Libraries
+Version: unspecified
+OS: other
+OS Details: Linux Mandrake cooker
+Status: NEW
+Resolution:
+Severity:
+Priority: Wishlist
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: kelk1@hotmail.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: System.DateTime.ToLocalTime returns UTC time
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+I get the same results, whether I use ToLocalTime() or not
+
+Steps to reproduce the problem:
+1. Compile and run the following code:
+using System ;
+class UTCLocal
+{
+ static void Main()
+ {
+ DateTime date = DateTime.UtcNow ;
+ Console.WriteLine("Time (UTC) is : " + date.ToLongTimeString()) ;
+ Console.WriteLine("Time (local) is: " +
+date.ToLocalTime().ToLongTimeString()) ;
+ }
+}
+
+Actual Results:
+Time (UTC) is : 15:17:52
+Time (local) is: 15:17:52
+
+Expected Results:
+Time (UTC) is : 15:17:52
+Time (local) is: 07:17:52
+
+How often does this happen?
+Always
+
+Additional Information:
+$ date
+Thu Jan 9 07:27:06 PST 2003
+$ date -u
+Thu Jan 9 15:28:07 UTC 2003
+
+The hardware clock is set to local time:
+# clock --show
+Thu 09 Jan 2003 07:34:11 AM PST -0.602683 seconds
+
+The same binary copied over and run in Windows98 works fine:
+Time (UTC) is : 3:17:52 PM
+Time (local) is: 7:17:52 AM
+
+mono and mcs version 0.17