Is there a DateTimeFormatInfo
format pattern to convert a day of week to two characters? For example Tuesday becomes Tu, Wednesday becomes We. The format string needs to conform to the DateTimeFormatInfo
for date formats.
Addition:
Maybe I am looking for a solution to extend DateTimeFormatInfo
to include custom formats?
The closes you can get is the "ddd"
custom format specifier - this produces three lettered abbreviations, so not exactly what you want. There is nothing built in that does exactly what you want.
You can always take the first two characters of that:
DateTime.Now.ToString("ddd").Substring(0,2);
Unfortunately you can't extend DateTimeFormatInfo
since it is declared as sealed
.