Get error while trying to change the format of date

get this error :
Assign: Expression Activity type ‘VisualBasicValue`1’ requires compilation in order to run. Please ensure that the workflow has been compiled.

on an assign activity where i trying to change the date format
Convertdate (datetime type) = Datetime.ParseExact( SplitEnddate,“MM/dd/yyyy”,System.Globalization.CultureInfo.InvariantCulture)

splitend date is 31-01-2023 11:59:59 PM where is split it with space and date only split date

can someone help me with this

Hi @manoj2500 ,

Can you send the screenshot of SplitEnddate variable value?

split end date is is like this 31-01-2023 11:59:59 PM
i have split it with space and got only date in splitenddate
@Manish540

Update your double quotes:

Datetime.ParseExact( SplitEnddate,"MM/dd/yyyy",System.Globalization.CultureInfo.InvariantCulture)

2 Likes

Hi @manoj2500 ,

No need to split the date you can use below code to convert it to datetime type,

DateVar(datetime variable type) = System.DateTime.ParseExact("31-01-2023 11:59:59 PM","dd-MM-yyyy hh:mm:ss tt", System.Globalization.CultureInfo.InvariantCulture)

Hope this helps :slight_smile:

@manoj2500
Try this
Convertdate (datetime type) = Datetime.ParseExact( SplitEnddate,“dd-MM-yyyy”,System.Globalization.CultureInfo.InvariantCulture)

Hi @manoj2500 ,

The Error and it’s fix is mentioned in this post, Could you check this and let us know if you were able to fix it :

why bcoz of double quotes it created an issue
@ptrobot @Suraj_B_Shetty @Manish540

The answer is in the article referenced above your post:

1 Like