[Mono-bugs] [Bug 40910][Maj] Changed - Bad "Z" mask parsing in DateTime
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
Wed, 9 Apr 2003 23:20:35 -0400 (EDT)
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 spouliot@videotron.ca.
http://bugzilla.ximian.com/show_bug.cgi?id=40910
--- shadow/40910 Mon Apr 7 21:22:09 2003
+++ shadow/40910.tmp.8199 Wed Apr 9 23:20:35 2003
@@ -1,13 +1,13 @@
Bug#: 40910
Product: Mono/Class Libraries
Version: unspecified
OS: unknown
OS Details: probably linux too
-Status: RESOLVED
-Resolution: FIXED
+Status: REOPENED
+Resolution:
Severity: Unknown
Priority: Major
Component: CORLIB
AssignedTo: mono-bugs@ximian.com
ReportedBy: spouliot@videotron.ca
QAContact: mono-bugs@ximian.com
@@ -67,6 +67,32 @@
Additional Information:
Seems that "Z" (in mask) is not parsed correctly.
------- Additional Comments From gonzalo@ximian.com 2003-04-07 21:22 -------
Fixed in CVS.
+
+------- Additional Comments From spouliot@videotron.ca 2003-04-09 23:20 -------
+Convertion from UTC to localtime doesn't work with first patch (but
+the exceptions have disappeared).
+
+Sample code:
+
+
+static void Main (string[] args)
+{
+ string input = "20030407210500Z";
+ string mask = "yyyyMMddHHmmssZ";
+ Console.WriteLine ("Input: {0}\tMask: {1}", input, mask);
+ DateTime t = DateTime.ParseExact (input, mask, null);
+ Console.WriteLine ("ParseExact (localtime) {0}", t);
+ Console.WriteLine ("ToUniversalTime() {0}", t.ToUniversalTime
+());
+}
+
+Results (on Linux)
+
+[23:19] <BenM> [05mauben@james tmp]$ mono test.exe
+[23:19] <BenM> Input: 20030407210500Z Mask: yyyyMMddHHmmssZ
+[23:19] <BenM> ParseExact (localtime) Monday, 07 April 2003 21:05:00
+[23:19] <BenM> ToUniversalTime() Tuesday, 08 April 2003 01:05:00
+[23:19] <BenM> [05mauben@james tmp]$