Hello everyone,
I have an excel sheet with a few columns. Every column starts with a specific month
Like this:
Now I want to convert the number from each month to the first three letters of each month
(7 → Jul, 8 → Aug)
I tried it like this:
- read each cell and save it as “DTMN”
- Str ShortMonth = DTMN.toString
-ShortMonth = DateTime.ParseExact(ShortMonth, “MM”, System.Globalization.CultureInfo.InvariantCulture).ToString(“MMM”)
But this code only works for month with two numbers (10, 11, 12)
For the other numbers I get the Error: String was not recognized as a valid DateTime