mail-archives/mono-bugs/2005-June/030806.html

161 строка
5.3 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Mono-bugs] [Bug 75353][Nor] New - DateTime.Parse problem en-GB: ok
on 1.1.6, fails on 1.1.8
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%2075353%5D%5BNor%5D%20New%20-%20DateTime.Parse%20problem%20en-GB%3A%20ok%0A%09on%201.1.6%2C%20fails%20on%201.1.8&In-Reply-To=bug-75353%40chernobyl.ximian.com">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="030805.html">
<LINK REL="Next" HREF="030808.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Mono-bugs] [Bug 75353][Nor] New - DateTime.Parse problem en-GB: ok
on 1.1.6, fails on 1.1.8</H1>
<B>bugzilla-daemon at bugzilla.ximian.com</B>
<A HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%2075353%5D%5BNor%5D%20New%20-%20DateTime.Parse%20problem%20en-GB%3A%20ok%0A%09on%201.1.6%2C%20fails%20on%201.1.8&In-Reply-To=bug-75353%40chernobyl.ximian.com"
TITLE="[Mono-bugs] [Bug 75353][Nor] New - DateTime.Parse problem en-GB: ok
on 1.1.6, fails on 1.1.8">bugzilla-daemon at bugzilla.ximian.com
</A><BR>
<I>Wed Jun 22 14:59:49 EDT 2005</I>
<P><UL>
<LI>Previous message: <A HREF="030805.html">[Mono-bugs] [Bug 75236][Nor] Changed - [PATCH] MethodBuilder no
longer allows zero-length both in MS.NET 2.0
</A></li>
<LI>Next message: <A HREF="030808.html">[Mono-bugs] [Bug 75354][Nor] New - MySql problem, ok on 1.1.4,
fails on 1.1.8
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#30806">[ date ]</a>
<a href="thread.html#30806">[ thread ]</a>
<a href="subject.html#30806">[ subject ]</a>
<a href="author.html#30806">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>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 <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">kevin-f at linkprior.com.</A>
<A HREF="http://bugzilla.ximian.com/show_bug.cgi?id=75353">http://bugzilla.ximian.com/show_bug.cgi?id=75353</A>
--- shadow/75353 2005-06-22 14:59:49.000000000 -0400
+++ shadow/75353.tmp.22108 2005-06-22 14:59:49.000000000 -0400
@@ -0,0 +1,86 @@
+Bug#: 75353
+Product: Mono: Class Libraries
+Version: 1.1
+OS: SUSE 9.2
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: System
+AssignedTo: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">mono-bugs at ximian.com</A>
+ReportedBy: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">kevin-f at linkprior.com</A>
+QAContact: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">mono-bugs at ximian.com</A>
+TargetMilestone: ---
+URL:
+Cc:
+Summary: DateTime.Parse problem en-GB: ok on 1.1.6, fails on 1.1.8
+
+Please fill in this template when reporting a bug, unless you know what
+you are doing.
+Description of Problem:
+Under en-GB CultureInfo, DateTime.ToShortDateString produces correct
+format but DateTime.Parse does not convert it back - swaps over day &amp;
+month so produces wrong value or throws FormatException.
+
+Steps to reproduce the problem:
+1. Compile and run this code:
+
+//
+// code starts
+//
+using System;
+
+namespace test
+{
+ class Class1
+ {
+
+ static void Main(string[] args)
+ {
+ String s;
+ DateTime d;
+
+ // Set en-GB culture
+ System.Globalization.CultureInfo ci;
+ ci = new System.Globalization.CultureInfo(&quot;en-
+GB&quot;);
+
+ System.Threading.Thread.CurrentThread.CurrentCulture = ci;
+
+ // Get a date
+ d = DateTime.Parse(&quot;2005-09-13&quot;);
+
+ // Convert to string and display
+ s = d.ToShortDateString();
+ Console.WriteLine(s);
+
+ // Convert back and display
+ // - works on Mono 1.1.6, fails on 1.1.8.1
+ d = DateTime.Parse(s);
+
+ Console.WriteLine(d.ToShortDateString());
+ Console.Read();
+
+
+ }
+ }
+}
+
+//
+// code ends
+//
+
+Actual Results:
+Date written to console once, then FormatException.
+
+Expected Results:
+Date written to console twice.
+
+How often does this happen?
+
+
+Additional Information:
+Knock-on effects for things like setting DataView.RowFilter when date
+literal used, e.g. dv.RowFilter = &quot;TALK_DATE &lt; #&quot; &amp;
+dNextMtgDate.ToShortDateString &amp; &quot;#&quot;
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="030805.html">[Mono-bugs] [Bug 75236][Nor] Changed - [PATCH] MethodBuilder no
longer allows zero-length both in MS.NET 2.0
</A></li>
<LI>Next message: <A HREF="030808.html">[Mono-bugs] [Bug 75354][Nor] New - MySql problem, ok on 1.1.4,
fails on 1.1.8
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#30806">[ date ]</a>
<a href="thread.html#30806">[ thread ]</a>
<a href="subject.html#30806">[ subject ]</a>
<a href="author.html#30806">[ author ]</a>
</LI>
</UL>
<hr>
<a href="http://lists.ximian.com/mailman/listinfo/mono-bugs">More information about the mono-bugs
mailing list</a><br>
</body></html>