I have a problem with 'd' specifier in DateTime format string. MSDN says:
The "d" custom format specifier represents the day of the month as a number from 1 through 31. A single-digit day is formatted without a leading zero.
If I use this format specifier with other symbols in format string the result will be correct:
DateTime date1 = new DateTime(2008, 1, 2, 6, 30, 15);
Console.WriteLine(date1.ToString("d ")); //with space after 'd'
//displays: 2
but if I remove space from this sample
Console.WriteLine(date1.ToString("d"));
the result becomes to "1/2/2008".
Why result string depends on format string length? And how can I avoid this?