[Mono-bugs] [Bug 47720][Wis] New - DateTime.Parse (RFC1123) does not handle timezone
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Fri, 9 Jan 2004 23:54:31 -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 micke@imendio.com.
http://bugzilla.ximian.com/show_bug.cgi?id=47720
--- shadow/47720 2004-01-09 23:54:31.000000000 -0500
+++ shadow/47720.tmp.22554 2004-01-09 23:54:31.000000000 -0500
@@ -0,0 +1,62 @@
+Bug#: 47720
+Product: Mono/Class Libraries
+Version: unspecified
+OS: unknown
+OS Details:
+Status: NEW
+Resolution:
+Severity: Unknown
+Priority: Wishlist
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: piersh@friskit.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Summary: DateTime.Parse (RFC1123) does not handle timezone
+
+Here's an example:
+
+using System;
+class Test
+{
+ public static void Main (string [] rgszArgs)
+ {
+ DateTime dt = DateTime.Parse ("Sat, 29 Oct 1994 12:00:00
+GMT");
+ Console.WriteLine (dt);
+ }
+}
+
+On windows, with my timezone set to PDT (pacific + daylight), the above
+program prints:
+10/29/1994 5:00:00 AM
+
+Whereas on my linux box I get:
+10/29/1994 12:00:00
+
+------- Additional Comments From gonzalo@ximian.com 2003-08-18 23:22 -------
+I tried uncommenting the 'useutc = true' in the 'r' case that handles
+known formats.
+
+Doing that, I get (GMT+2 right now):
+10/29/1994 13:00:00
+
+Ie, it seems that it does not count DTS (ie, it gets the DTS from the
+date, not the current one).
+
+------- Additional Comments From micke@imendio.com 2004-01-09 23:54 -------
+When running the above I get FormatException, I need to run:
+
+DateTime dt = DateTime.Parse ("Sat, 29 Oct 1994 12:00:00 GMT",
+CultureInfo.InvariantCulture);
+
+Also,
+
+DateTime dt = DateTime.Parse ("Sat, 29 Oct 1994 12:00:00 -0400",
+CultureInfo.InvariantCulture);
+
+Doesn't seem to work, but if I understand correctly it should. Should
+I report that as it's own bug?
+
+