I have a simple problem: I want to write the date in an asp:label in the following format:
MMM dd, yyyy
I tried this:
lblDate.Text = System.DateTime.Today.ToString("MMM dd, yyyy");
the result is: “okt. 12, 2012”
- I want to remove the dot from it.
- The month’s name should begin with a capital letter.
the right format: “Okt 12, 2012”
how can I do this?
You can use the AbbreviatedMonthNames property for this:
Then output will be
Okt 12, 2012