http://bugzilla.novell.com/show_bug.cgi?id=541959
Summary: DateTime is incorrect during DST transition times
Classification: Mono
Product: Mono: Class Libraries
Version: 2.4.x
Platform: Other
OS/Version: Ubuntu
Status: NEW
Severity: Normal
Priority: P5 - None
Component: System
AssignedTo: [email protected]
ReportedBy: [email protected]
QAContact: [email protected]
Found By: ---
Created an attachment (id=319787)
--> (http://bugzilla.novell.com/attachment.cgi?id=319787)
test case
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.12)
Gecko/20080207 Ubuntu/7.10 (gutsy) Firefox/2.0.0.12
During Daylight Savings transitions in the US Eastern timezone, the 2:00 to
3:00 hour disappears. Mono is erasing the 1:00 to 2:00 hour instead.
Reproducible: Always
Steps to Reproduce:
using System;
class TimeTest {
public static void Main() {
testDate(Convert.ToDateTime("2007-03-11 06:00:00"));
testDate(Convert.ToDateTime("2007-03-11 06:30:00"));
testDate(Convert.ToDateTime("2007-03-11 07:00:00"));
}
private static void testDate(DateTime dt) {
DateTime utc = dt.ToUniversalTime();
utc = utc.AddHours(-4);
Console.Write("UTC: " + utc);
DateTime local = utc.ToLocalTime();
Console.WriteLine(" --> Local: " + local);
}
}
Actual Results:
UTC: 3/11/2007 6:00:00 AM --> Local: 3/11/2007 1:00:00 AM
UTC: 3/11/2007 6:30:00 AM --> Local: 3/11/2007 2:30:00 AM
UTC: 3/11/2007 7:00:00 AM --> Local: 3/11/2007 3:00:00 AM
Expected Results:
UTC: 3/11/2007 6:00:00 AM --> Local: 3/11/2007 1:00:00 AM
UTC: 3/11/2007 6:30:00 AM --> Local: 3/11/2007 1:30:00 AM
UTC: 3/11/2007 7:00:00 AM --> Local: 3/11/2007 3:00:00 AM
--
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
_______________________________________________
mono-bugs maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs