I am using the following to format a DateTime
:
DateTime CusDate = dateTimePicker1.Value;
string Date = CusDate.ToString("ddMMMyyyy");
I am getting the format such that "Nov" is not in upper case:
04Nov2011
But I want the format of "Nov" in capital letters, like this:
04NOV2011
This is because I am downloading a file from a website programatically which is in this format.
Format dates to uppercase months with formulas Select a blank cell (C2) besides the date cell you need to format to uppercase month, enter formula =UPPER(TEXT(A2,"mmm")) into the Formula Bar, and then press the Enter key. See screenshot: Then you will get the abbreviation of month in uppercase.
The T doesn't really stand for anything. It is just the separator that the ISO 8601 combined date-time format requires. You can read it as an abbreviation for Time. The Z stands for the Zero timezone, as it is offset by 0 from the Coordinated Universal Time (UTC).
Just do the string ToUpper():
DateTime CusDate = dateTimePicker1.Value;
string Date = CusDate.ToString("ddMMMyyyy").ToUpper();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With