How to convert date from general format to DateTime format

We are trying to read excel having one of the column as the date. After reading the excel we have taken the result in a datatable. Now we are trying to get the each date from the datatable.
When the excel was read it converted all the date value to the general format.

Now how to convert the date from the general format to the DateTime format as we want to compare the each value to the present date.
Here is the file for the reference.
DOB.xlsx (9.4 KB)

Hi @Tanvi_sharma, try below, should work

dateTime dt = DateTime.ParseExact([your column].toString, “MM/dd/yyyy”,System.Globalization.CultureInfo.InvariantCulture)
string strOut = dt.ToString(“MM/dd/yyyy”)

use Cdate(strOut) function

Hope it helps!

Hi Tanvi,

Below thread might help you with your requirement.



In your case date value is not complete. So use the below expression in assign activity to convert into data value

datatime_variable = DateTime.ParseExact("18-Jun", “dd-MMM”,System.Globalization.CultureInfo.InvariantCulture).tostring