How to get month DateTime in uppercase?

I use the following to format DateTime :

 DateTime CusDate = dateTimePicker1.Value; string Date = CusDate.ToString("ddMMMyyyy"); 

I get the format so that "new" is not in uppercase:

 04Nov2011 

But I want the Nova format in capital letters, for example:

 04Nov2011 

This is because I download the file from the website programmatically, which is in this format.

+6
source share
4 answers

Just enter the line ToUpper ():

  DateTime CusDate = dateTimePicker1.Value; string Date = CusDate.ToString("ddMMMyyyy").ToUpper(); 
+14
source

After you are done with toString ...

 string date = date.ToUpper(); 
+2
source

Use the String.ToUpper() method:

 DateTime CusDate = dateTimePicker1.Value; string Date = CusDate.ToString("ddMMMyyyy").ToUpper(); 
+2
source

Converting a string to uppercase (does not affect numbers):

 DateTime CusDate = dateTimePicker1.Value; string Date = CusDate.ToString("ddMMMyyyy").ToUpper(); 
+2
source

Source: https://habr.com/ru/post/901928/


All Articles