Date Comparison in all possible scenarios

Hello

I have a use case where the date field can be in two formats with variants

Format1 >> 05-Apr-2019
Format2>>05-Apr-2019 - 10-Apr-2019 or 1-31, Jan,2019 (other variants)

Now in each of these formats I can have any variant of date
Eg:
01/12/2019
12/01/2019
20190112
12 January 2019
12-Jan-19

But in MM/DATE/YEAR sequence .

I require a way where i can first evaluate the format and then match it against any of the posisble variants (Eg+any other possible date formats as it can be anything)

and then convert the found variant to a fixed normal format like 04052019 or 04/05/2019 (MM/DD/YYYY)

in case of case two (format2) , once the date range is converted to fixed normal format , bot checks a specific date in same format whether it lies in the date range or not

What is the best startergy to do this (using either VB code or activities)

Please advise

I recommend to use vb code (Invoke code) activity to get the string for the matching format using DateTime.Format conditions or Regular expressions for better project organization.

Regards,
Karthik Byggari

Thanks Karthik, But what would be the logic for such a case. My main concern is how can make a universal logic that can understand any time of date format and convert it to a fixed one. What kind of vb code/regex can help me with that?