All dates format in a given string

@alpharobot

the formats are configured in a dt:
grafik

so it can be externalized (less formats can be handled in comma seperated string and handled with String .Split…)

following parse is handling many formats in one statement:
DateTime.ParseExact(row(0).ToString.trim, arrFormats, cultureinfo, DateTimeStyles.None)

most of the dates are parsed:
[Column1
22-MAR-2020
18/03/2020
09/04/2020
30/03/2020
20/03/2020
04/03/2020
04/04/2020
]

22-MAR-2020 is not a valid date string and is confusing. So I suggest to you a further RnD:

However it is handled by a try catch and do not block the other dates:

Starter Help here:
Parsing_MultipleFormats_DTConfig.xaml (13.4 KB)

3 Likes