Q:

Date Time Conversion not working for a custom string of datetime

I have this string 01-Oct-19-03_13_AM when i try to DateTime.Parse method it says String was not recognized as a valid DateTime. Any Solution will be helpful.

A:

You can use ParseExact, or TryParseExact with a specified custom format to achieve this.
The custom date format specifies each part of the date in the format you have it.  In your case, it should be:
01-Oct-19-03_13_AM
dd-MMM-yy-hh_mm_tt

Here's an example with TryParseExact (my preference):
if (DateTime.TryParseExact("01-Oct-19-03_13_AM", "dd-MMM-yy-hh_mm_tt", null, System.Globalization.DateTimeStyles.None, out DateTime myDate))
    Console.WriteLine(myDate);

This outputs:
01/10/2019 03:13:00

For your reference, custom date formats are described in the official documentation.

