by Michael S. Kaplan, published on 2006/03/14 08:35 -05:00, original URI: http://blogs.msdn.com/b/michkap/archive/2006/03/14/551112.aspx
(no, this post is not about a rap or hip hop song, or its lyrics, though I admit the title may have been inspired by one!)
Internationalization guru Bill Hall asked of some folks here:
I have a small question to ask. Some time ago when you were helping me with some issues in my monographs on .NET I18n, you once sent me a response saying that it was rather strange that I would run through the standard number formats using the single ascii character formatters a-z and A-Z, trying each one to see if a corresponding format or number expression would emerge. As it happened in that instance, I discovered that the ‘P’ and ‘p’ formats for percentage were not documented anywhere in .NET 1.1.
Well, I’m doing a series for multilingual about what is new for .NET 2.0 and I tried the same experiment, this time for DateTime. Guess what? The ‘o’ and ‘O’ formats are missing in the .NET 2.0 documentation! The pattern is yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK for both, and it is clearly an ISO 8601 form but I cannot find any reference to it.
It would be nice to know what .NET calls it. ISO calls it a ‘complete’ format – a bit vague. I’d like to provide the official .NET name in my article and I wonder if you could help.
Many thanks.
Well, I agree with Bill here -- it is hard to argue with results, and clearly he is managing to stay at least a few steps in front of the documentation by using such tricks. It keeps us honest. :-)
So, there are the existing, documented formats you can find in the DateTimeFormatInfo.GetAllDateTimePatterns(char) overload -- this lists some of them, but there are many more, some that can be found in other help topics. Here is the full list as of 2.0 for date formats, all of the ones that can be used with that method:
(The items in green are independent of culture, while the ones in black are not.
As the above list indicates, I do not know of an official name for this 'o'/'O' format: no one I talked to does (through reflection, you can see the name of the format is DateTimeFormat.RoundtripFormat, but that is not the actual name, it is just an internal thing).
Enjoy!
This post brought to you by "O" (U+004f, a.k.a. LATIN CAPITAL LETTER O)
Adam on 14 Mar 2006 9:58 AM:
Michael S. Kaplan on 14 Mar 2006 3:32 PM:
Mattias on 14 Mar 2006 4:56 PM:
Michael S. Kaplan on 14 Mar 2006 7:36 PM:
Dean Harding on 15 Mar 2006 9:20 PM:
referenced by
2011/06/08 Wait til you see my Õ (Ō), Latvian edition