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’.
The following code is based on that answer that generates an ordinal from an integer:
Than you can generate your output string: