[Mono-bugs] [Bug 61112][Nor] New - DateTime conversion UTC->local->UTC gives incorrect date

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 2 Jul 2004 17:29:27 -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 t7@pobox.com.

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

--- shadow/61112	2004-07-02 17:29:27.000000000 -0400
+++ shadow/61112.tmp.24502	2004-07-02 17:29:27.000000000 -0400
@@ -0,0 +1,57 @@
+Bug#: 61112
+Product: Mono: Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: t7@pobox.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: DateTime conversion UTC->local->UTC gives incorrect date
+
+Description of Problem:
+For some dates, valid DateTime in UTC can be converted into local time
+and then back to UTC time with a different result.
+
+Steps to reproduce the problem:
+1. Run test program below
+2. 
+3. 
+
+Actual Results:
+time(UTC)=10/27/1996 7:56:40 AM as local=10/27/1996 2:56:40 AM and back to
+UTC=10/27/1996 6:56:40 AM
+
+
+Expected Results:
+time(UTC)=10/27/1996 7:56:40 AM as local=10/27/1996 2:56:40 AM and back to
+UTC=10/27/1996 7:56:40 AM
+
+How often does this happen? 
+always
+
+Additional Information:
+Redhat fedora core 2, Mono 1.0 release install
+
+using System;
+using System.IO;
+
+class TimeTest
+{
+
+  public static void Main()
+  {
+    DateTime time = DateTime.Parse("10/27/1996 7:56:40 AM");
+
+    Console.WriteLine("time(UTC)="+time+" as local="+time.ToLocalTime()
+             +" and back to UTC="+time.ToLocalTime().ToUniversalTime());
+  }
+
+}