string a="31/2/2014"; string[] parts = a.Split('/'); if (parts.Length >= 2) { return parts[1]; // and parts[0] has the day and parts[2] has the year } else // bad input
DateTime
DateTime dt = new DateTime(2014, 2, 31); int month = dt.Month;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)