| From: =?Utf-8?B?S0RW?= <kdv@discussions.microsoft.com>
|
| I am using the the date format string "dddd, MMMM dd, yyyy" which formats
| Date type to Monday, April 04, 2005. Is there any way I can specify in the
| format string so that the day should be in capital letter eg MONDAY, April
| 04, 2005. I don't want to parse myself.
You can define your own array of day names, and format with it:
DateTimeFormatInfo dtfi = new DateTimeFormatInfo();
dtfi.DayNames = new String[] { "SUNDAY", "MONDAY", "TUESDAY",
"WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", };
Console.WriteLine(dt.ToString("dddd, MMMM dd, yyyy", dtfi));
Parsing should already be case-insensitive.
Katy
CLR Testing
KDV - 05 Apr 2005 16:35 GMT
Thanks Karty. Actually in my application I was storing only the date format
string which was controlling how the date will be formatted. With this
approach I don't have to store only the date mask but also additional info
like whether to display Days/Months in uppercase or lowercase.( 24 entries
for the month JAN/JANUARY
and 14 for the Days SUN/SUNDAY). I think this is the way it gonna work.
Thanks for the reply
> | From: =?Utf-8?B?S0RW?= <kdv@discussions.microsoft.com>
> |
[quoted text clipped - 16 lines]
> Katy
> CLR Testing