[Mono-bugs] [Bug 82142][Nor] Changed - DateTime.Now.ToString("o") NullReferenceException

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu Jul 19 12:03:22 EDT 2007

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 ward.mark at gmail.com.


--- shadow/82142	2007-07-19 11:44:06.000000000 -0400
+++ shadow/82142.tmp.32146	2007-07-19 12:03:22.000000000 -0400
@@ -1,14 +1,14 @@
 Bug#: 82142
 Product: Mono: Class Libraries
 Version: 1.2
+OS: unknown
 OS Details: Windows 2003
 Status: NEW   
+Severity: Unknown
 Priority: Normal
 Component: System
 AssignedTo: mono-bugs at ximian.com                            
 ReportedBy: ward.mark at gmail.com               
 QAContact: mono-bugs at ximian.com
 TargetMilestone: ---
@@ -37,6 +37,32 @@
 Example: 2007-07-19T07:33:30.671875-05:00  
 How often does this happen? 
 Every time the application is run.
 Additional Information:
+------- Additional Comments From ward.mark at gmail.com  2007-07-19 12:03 -------
+It appears the ToString(string format) method does not contain a
+definition to handle 'o' in the internal static string
+_GetStandardPattern (char format, DateTimeFormatInfo dfi, out bool
+useutc, out bool use_invariant) method.
+ case 'O':
+ case 'o':
+    return "yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK";
+since this is happening the default: pattern = null; break; is hit. 
+In the Microsoft documentation there is the definition for 'o' and in
+their  DateTime example it contains the following lines.
+Console.WriteLine(msgRoundtripLocal       &       
+thisDate.ToString("o"), ci)
+        Console.WriteLine(msgRoundtripUTC         &        
+utcDate.ToString("o"), ci)
+        Console.WriteLine(msgRoundtripUnspecified &
+unspecifiedDate.ToString("o"), ci)

More information about the mono-bugs mailing list