Get Month Name and Day name for a Date in C#, ASP.Net
Sometimes, we may need to get the full month name and day name in ASP.Net from a given date.
In this small article, we will achieve this by 2 ways,
- The ToString() method of DateTime will acccept the formatting string through which we can display the full month and day name for a given date.
- The next method is to use DateTimeFormatInfo class of System.Globalization namespace. This class has GetMonthName() and GetDayName() method which gives the full month name and day name.
DateTimeFormatInfo dinfo = new DateTimeFormatInfo();
Include System.Globalization namespace for the above code to work.