Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get DateTime month in upper case?

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.

like image 683
Sharrok G Avatar asked Nov 20 '11 08:11

Sharrok G


People also ask

How to make month uppercase in excel?

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.

What is T and Z in datetime C?

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).


1 Answers

Just do the string ToUpper():

    DateTime CusDate = dateTimePicker1.Value;
    string Date = CusDate.ToString("ddMMMyyyy").ToUpper();
like image 59
Peter Avatar answered Nov 01 '22 07:11

Peter