I have an excel Table with a Date Column that is populated with different dates in string format.
Since its in excel, the type of the column comes under “General”.
The issue I am facing is as follows: the format can be anything in Excel as shown in the list below:
So parsing the String that comes from an Excel file becomes difficult, since the format can be anything present in the list above.
Is there any way to Detect the Format a given String is currently in, before we can parse it into Date?
Thank you for your response, you see the thing is the Dates are coming from 27 different types of invoices that even our client isn’t sure how many date formats are there.
Here are few formats I encountered:
10/03/2021
21.10.2021
2nd March 2021
This is where it gets tricky, and the solution you quoted works only for the first format. And yes, I have imported the System.Globalization Namespace as you suggested.
@ashwin.ashok - the reason why 5/28 date failed because that is not in indian date format. You can play around all these date formats in Immediate panel.