https://bugzilla.novell.com/show_bug.cgi?id=376929
Summary: DateTime.ParseExact adds day when parsing minvalue
Product: Mono: Class Libraries
Version: SVN
Platform: All
OS/Version: All
Status: NEW
Severity: Normal
Priority: P5 - None
Component: CORLIB
AssignedTo: [email protected]
ReportedBy: [EMAIL PROTECTED]
QAContact: [email protected]
Found By: ---
When parsing an ISO 8601 date string representing DateTime.MinValue using
DateTime.ParseExact, an extra days is added to the resulting DateTime instance;
meaning you'll get 01/02/0001, instead of 01/01/0001.
To reproduce, compile and run the following code snippet using (g)mcs:
using System;
using System.Globalization;
using System.Xml;
class Program
{
static void Main ()
{
const string format = "yyyy-MM-ddTHH:mm:ss.fffffffzzz";
string d = DateTime.MinValue.ToString (format,
CultureInfo.InvariantCulture);
DateTime date = DateTime.ParseExact (d, format,
CultureInfo.InvariantCulture);
Console.WriteLine (date == DateTime.MinValue);
}
}
Expected result:
True
Actual result:
False
--
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.
_______________________________________________
mono-bugs maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs