Answers for "c# string to month"

C#
1

month number to text in c#

//For short month names 
string monthName = new DateTime(2010, 8, 1)
    .ToString("MMM", CultureInfo.InvariantCulture);

//For long/full month names for spanish("es") culture
string fullMonthName = new DateTime(2015, i, 1).ToString("MMMM", CultureInfo.CreateSpecificCulture("es"));

//or
string monthName = CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(8);
Posted by: Guest on May-11-2020
1

c# get month number

string sMonth = DateTime.Now.ToString("MM");
Posted by: Guest on July-28-2020

C# Answers by Framework

Browse Popular Code Answers by Language