[Mono-bugs] [Bug 75985][Nor] New - DateTime.Parse applies timezone incorrectly around daylight saving time transition

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Mon Sep 5 08:52:51 EDT 2005

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 brion at pobox.com.


--- shadow/75985	2005-09-05 08:52:51.000000000 -0400
+++ shadow/75985.tmp.12462	2005-09-05 08:52:51.000000000 -0400
@@ -0,0 +1,47 @@
+Bug#: 75985
+Product: Mono: Class Libraries
+Version: 1.1
+OS: All
+OS Details: 
+Status: NEW   
+Priority: Normal
+Component: System
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: brion at pobox.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: DateTime.Parse applies timezone incorrectly around daylight saving time transition
+Description of Problem:
+For timestamps with timezone information parsed via DateTime.Parse(),
+timezones are applied incorrectly for several hours around a daylight
+saving time transition.
+Steps to reproduce the problem:
+1. Set time zone to US Pacific (TZ=America/Los_Angeles)
+2. Console.WriteLine(DateTime.Parse("2003-10-26T04:50:47Z"))
+Actual Results:
+10/25/2003 8:50:47 PM
+Expected Results:
+10/25/2003 9:50:47 PM
+How often does this happen? 
+Every time.
+Additional Information:
+Using local time is unreliable in general as there are two real hours
+during autumn DST transition which map to the same localtime hour. But the
+surrounding hours should still round-trip correctly, and they should
+_always_ map correctly from UTC to local time.
+I've tested this with Mono on Windows XP and on Linux compiled from
+SVN 2005-08-27 with same results. MS .NET 1.1 on the Windows box gives
+correct local times results, with only the 'missing hour' failing to
+round-trip on a conversion back with ToUniversalTime().

More information about the mono-bugs mailing list