[Mono-bugs] [Bug 79809][Wis] New - DateTime.Parse does not handle "12 AM" nor "12 PM" correctly

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu Nov 2 13:09:52 EST 2006


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 prensing at cimetrics.com.

http://bugzilla.ximian.com/show_bug.cgi?id=79809

--- shadow/79809	2006-11-02 13:09:52.000000000 -0500
+++ shadow/79809.tmp.14826	2006-11-02 13:09:52.000000000 -0500
@@ -0,0 +1,58 @@
+Bug#: 79809
+Product: Mono: Class Libraries
+Version: 1.1
+OS: 
+OS Details: Fedora Core 5
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: System
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: prensing at cimetrics.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: DateTime.Parse does not handle "12 AM" nor "12 PM"  correctly
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+The DateTime.Parse() does not handle times like "12:00:00 AM" correctly.
+This is a classic; I saw the same thing in a Python library. The code
+assumes that "12 AM" is 12 hours past the start of the day, instead of 0
+hours. It also throws an exception when parsing "12:00:00 PM"; probably, it
+is adding 12 hours to the time and getting a time > 24hours.
+
+Steps to reproduce the problem:
+1. Run the provided program. 
+2. 
+3. 
+
+Actual Results:
+time='0:00:00' datetime='11/02/2006 00:00:00'
+time='12:00:00 AM' datetime='11/02/2006 12:00:00'
+time='12:00:01 AM' datetime='11/02/2006 12:00:01'
+time='12:00:00' datetime='11/02/2006 12:00:00'
+time='12:00:00 PM' datetime=FormatException
+time='12:00:01 PM' datetime=FormatException
+time='1:00:00 AM' datetime='11/02/2006 01:00:00'
+time='1:00:00 PM' datetime='11/02/2006 13:00:00'
+
+
+Expected Results:
+time='0:00:00' datetime='11/02/2006 00:00:00'
+time='12:00:00 AM' datetime='11/02/2006 00:00:00'
+time='12:00:01 AM' datetime='11/02/2006 00:00:01'
+time='12:00:00' datetime='11/02/2006 12:00:00'
+time='12:00:00 PM' datetime='11/02/2006 12:00:00'
+time='12:00:01 PM' datetime='11/02/2006 12:00:01'
+time='1:00:00 AM' datetime='11/02/2006 01:00:00'
+time='1:00:00 PM' datetime='11/02/2006 13:00:00'
+
+
+How often does this happen? 
+Always
+
+Additional Information:


More information about the mono-bugs mailing list