Hi everyone,
i have combobox which i list of all 12 months.
I display there name of each month.
But for the code i must convert it to number.
When i try to convert it i get error "String was not recognized as valid DateTime".
Here is the code:
//Month name , for example January
string month = comboBox3.Text.Trim();
//Month number according to selected month in combobox3
int month1 = DateTime.ParseExact(month, "MMM",CultureInfo.CreateSpecificCulture("en-GB")).Month;
Can you help me?
Thank you.

Rajanikant HawaldarRank #110 · 20.2K reputationPosted May 2, 2020, 7:06 AM EDT
Jignesh KumarRank #91 · 22.9K reputationPosted May 2, 2020, 6:52 AM EDT
Rajanikant HawaldarRank #110 · 20.2K reputationPosted May 2, 2020, 5:48 AM EDT
Vuk Stanojevic163 reputationPosted May 2, 2020, 6:47 AM EDT
@Rajanikant Hawaldar, unfortunatelly it didn't solve my problem, error is the same.
Rajanikant HawaldarRank #110 · 20.2K reputationPosted May 2, 2020, 7:13 AM EDT
Željko PerićRank #644 · 3.7K reputationPosted May 2, 2020, 8:16 AM EDT