I have the following line of code inside of a function:
String value = endDate.Value.ToString(dateFormatStr);
//endDate is a DateTime? object (returned from a LINQ to SQL query).
In the particular instance I am experiencing odd behavior, the value of endDate is {10/2/2010 12:00:00 AM}. Here's my results:
dateFormatStr="d" => value="10/2/2010" (I would expect "2")
dateFormatStr="M" => value="October 2" (I would expect "10")