Get Month Name From Given Date
If you need to get the date Name from give date use the below method. Don't foget to import System.Globalization namespace.
public static string GetMonthName(DateTime givenDate)
{
var formatInfoinfo = new DateTimeFormatInfo();
string[] monthName = formatInfoinfo.MonthNames;
return monthName[givenDate.Month - 1];
}
Comments
Post a Comment