Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Do I Produce a Date format like "1st November" in c#

Tags:

People also ask

How do you add th to a date format?

If the day number is 3 or 23, then Excel will apply the number format with “rd”. Create one final rule. Set the format to the custom number format we created with “th”. If the day number is between 4 and 20 (inclusive) or the day number is between 24 and 30 (inclusive) then apply the number format with “th”.

How do I show the date format?

The dates appear as, mm/dd/yyyy in the U.S. and as, dd/mm/yyyy outside the U.S. where mm is the month, dd is the day, and yyyy is the year. The time is displayed as, hh:mm:ss AM/PM, where hh is the hour, mm is minutes, and ss is seconds.


How can i get below mentions date format in c#.

  • For 1-Nov-2010 it should be display as : 1st November

  • For 30-Nov-2010 it should be display as : 30th November

Can we do using any date format or make a custom function that returns for 1 -> 'st', 2-> 'nd' 3-> 'rd', any date no -> 'th'.