c# date to month code example
Example 1: c# get month number
string sMonth = DateTime.Now.ToString("MM");
Example 2: find month number from date C#
string name = DateTime.ParseExact("01/21/2014", "MM/dd/yyyy", null).ToString("MMMM"); //January
string sMonth = DateTime.Now.ToString("MM");
string name = DateTime.ParseExact("01/21/2014", "MM/dd/yyyy", null).ToString("MMMM"); //January