Date Compilation Error

Hi All,

I am reading a DataTable from excel and I am removing the Time stamp from my Date .For that I am using

When I validate file no errors however it throws compilation error. I need to remove the Time stamp from currentrow(StartDate)

However getting error

image

Hi @marina.dutta

Please retype double quotes

DateTime.ParseExact(CurrentRow("StartDate").ToString,"MM/dd/yyyy hh:mm:ss",System.Globalization.CultureInfo.InvariantCulture).ToString("MM/dd/yyyy")

or

Input:

image

Regards,

1 Like

Hi @marina.dutta

Please retype the double quotes. And give the below syntax:

DateTime.ParseExact(CurrentRow("StartDate").ToString,"MM/dd/yyyy HH:mm:ss",System.Globalization.CultureInfo.InvariantCulture).ToString("dd/MM/yyyy")

Regards

1 Like

Hi @marina.dutta

Retype the double quotes and use System.Globalization.CultureInfo.InvariantCulture

Hope it helps!!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.