how to get month number from month name in c#

how to get month number from month name in c#:

step-1:
    inclued this name space
using System.Globalization;

step-2:
    use this code
string no= Convert.ToString(DateTime.ParseExact("may""MMMM"CultureInfo.InvariantCulture).Month)

Here instead of "may" you can give your month name.

No comments:

Post a Comment