[Mono-bugs] [Bug 376929] DateTime.ParseExact adds day when parsing minvalue

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Apr 4 03:12:07 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=376929

User gert.driesen at pandora.be added comment
https://bugzilla.novell.com/show_bug.cgi?id=376929#c1





--- Comment #1 from Gert Driesen <gert.driesen at pandora.be>  2008-04-04 01:12:06 MST ---
The problem appears to be that I'm at a positive UTC offset (GMT+1).

DateTime.MinValue with the specified format results in the following string:
0001-01-01T00:00:00.0000000+01:00

In DateTime._DoParse, we substract the UTC offset from the date to get the UTC
time. This results in a negative tick count, which we "correct" by adding the
tickcount for a day (??).

At this point, we have the following UTC time:

0001-01-01T23:00:00.0000000

Finally, we change it into local time and this gets us:

0001-01-02T00:00:00.0000000

which is of course wrong!


-- 
Configure bugmail: https://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.


More information about the mono-bugs mailing list