Date Formats in C #

I need to display dates in a month, a year (example: January 20, 2010).

Any suggestion?

+4
source share
4 answers
var dt = new DateTime(2010, 20, 1); string s = dt.ToString("MMMM dd, yyyy"); 

See here for more details .

+6
source

See this MSDN document. Contains all the information needed for custom date and time format strings.

http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx

Probably worth the bookmarks as well, I always come back to it.

0
source

Use String.Format(formatspecifier)

Custom Number Format Strings

0
source

Try DateField.ToString("MMMM-dd-yyyy");

0
source

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


All Articles