Author: atsushi
Date: 2007-11-01 05:16:02 -0500 (Thu, 01 Nov 2007)
New Revision: 88631
Modified:
trunk/mcs/class/corlib/System/ChangeLog
trunk/mcs/class/corlib/System/DateTime.cs
trunk/mcs/class/corlib/Test/System/ChangeLog
trunk/mcs/class/corlib/Test/System/DateTimeTest.cs
Log:
2007-11-01 Atsushi Enomoto <[EMAIL PROTECTED]>
* DateTime.cs : in roundtrip mode, 'Z' should turn the tick value to
utc time and should not result in different ticks.
Fixed bug #338064.
* DateTimeTest.cs : fixed bug #338064.
Modified: trunk/mcs/class/corlib/System/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/System/ChangeLog 2007-11-01 09:45:32 UTC (rev
88630)
+++ trunk/mcs/class/corlib/System/ChangeLog 2007-11-01 10:16:02 UTC (rev
88631)
@@ -1,3 +1,9 @@
+2007-11-01 Atsushi Enomoto <[EMAIL PROTECTED]>
+
+ * DateTime.cs : in roundtrip mode, 'Z' should turn the tick value to
+ utc time and should not result in different ticks.
+ Fixed bug #338064.
+
2007-10-30 Miguel de Icaza <[EMAIL PROTECTED]>
* UInt32.cs (Parse): Use Jeff Stedfast's parsing code which is
Modified: trunk/mcs/class/corlib/System/DateTime.cs
===================================================================
--- trunk/mcs/class/corlib/System/DateTime.cs 2007-11-01 09:45:32 UTC (rev
88630)
+++ trunk/mcs/class/corlib/System/DateTime.cs 2007-11-01 10:16:02 UTC (rev
88631)
@@ -1547,6 +1547,7 @@
case 'K':
if (s [valuePos] == 'Z') {
valuePos++;
+ useutc = true;
explicit_kind =
DateTimeKind.Utc;
}
else if (s [valuePos] == '+' || s
[valuePos] == '-') {
Modified: trunk/mcs/class/corlib/Test/System/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/Test/System/ChangeLog 2007-11-01 09:45:32 UTC
(rev 88630)
+++ trunk/mcs/class/corlib/Test/System/ChangeLog 2007-11-01 10:16:02 UTC
(rev 88631)
@@ -1,3 +1,7 @@
+2007-11-01 Atsushi Enomoto <[EMAIL PROTECTED]>
+
+ * DateTimeTest.cs : fixed bug #338064.
+
2007-10-27 Zoltan Varga <[EMAIL PROTECTED]>
* TypeTest.cs (InvokeMember_VarArgs): Enable this test.
Modified: trunk/mcs/class/corlib/Test/System/DateTimeTest.cs
===================================================================
--- trunk/mcs/class/corlib/Test/System/DateTimeTest.cs 2007-11-01 09:45:32 UTC
(rev 88630)
+++ trunk/mcs/class/corlib/Test/System/DateTimeTest.cs 2007-11-01 10:16:02 UTC
(rev 88631)
@@ -2114,6 +2114,20 @@
Assert.AreEqual
("2000-01-01T00:00:00.0000000+09:00".Length, DateTime.SpecifyKind (
new DateTime (2000, 1, 1),
DateTimeKind.Local).ToString ("o").Length, "#3");
}
+
+ [Test]
+ [Category ("NotDotNet")]
+ public void RundtripKindPattern ()
+ {
+ // only 2.0 supports 'K'
+ string format = "yyyy-MM-ddTHH:mm:ss.FFFK";
+ CultureInfo ci = CultureInfo.CurrentCulture;
+ DateTime dt = DateTime.UtcNow;
+ string s = dt.ToString
(format);//"2007-11-01T10:03:48.39Z";
+ DateTime d1 = DateTime.ParseExact (s, format, ci);
+ Assert.AreEqual (dt.Ticks, d1.Ticks, "#1");
+ Assert.AreEqual (DateTimeKind.Utc, d1.Kind, "#2");
+ }
#endif
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches