[Mono-bugs] [Bug 52075][Nor] New - Incorrect DateTime.MaxValue.Year value
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Wed, 21 Jan 2004 08:28:04 -0500 (EST)
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 rkumar@novell.com.
http://bugzilla.ximian.com/show_bug.cgi?id=52075
--- shadow/52075 2004-01-21 08:28:04.000000000 -0500
+++ shadow/52075.tmp.2293 2004-01-21 08:28:04.000000000 -0500
@@ -0,0 +1,64 @@
+Bug#: 52075
+Product: Mono/Class Libraries
+Version: unspecified
+OS: unknown
+OS Details: Slackware 9.1 kernel 2.4.22
+Status: NEW
+Resolution:
+Severity: Unknown
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: bk@slashdev.it
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Summary: Incorrect DateTime.MaxValue.Year value
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+even if DateTime.MaxValue.ToString() returns "31/12/99 23:59:59",
+DateTime.MaxValue.Year returns 10000
+
+Steps to reproduce the problem:
+Run this test
+using System;
+public class DateTimeTest {
+ [STAThread]
+ static void Main(){
+ Console.WriteLine("MaxYear: " + DateTime.MaxValue.Year);
+ }
+}
+
+
+Actual Results:
+10000
+
+Expected Results:
+9999
+
+How often does this happen?
+Always
+
+Additional Information:
+Mono JIT compiler version 0.29.99.20031211
+On ms's framework returns 9999
+
+Massimo Prota
+
+------- Additional Comments From gonzalo@ximian.com 2003-12-12 02:06 -------
+2003-12-06 Ravindra <rkumar@novell.com>
+
+ * DateTime.cs: Made Parse(string, IFormatProvider) method to
+ use second argument. Fixed bug #51464.
+
+Seems like this changed the Ticks and this makes this bug happen.
+Ravindra?
+
+------- Additional Comments From rkumar@novell.com 2004-01-21 08:28 -------
+Gonzalo, my fix has nothing to with MaxValue. MAX_VALUE_TICKS is a
+hardcoded value in DateTime.cs. I have tested by reverting back my
+fix also and I got the same value i.e. 10000. I found that ticks
+value is same as that in MS.NET, I think we need to look at the logic
+of calculating the year value from ticks.