How to convert string datatype to datetime datatype

Hi,
I have an assign activity Receiveddate=6-jun-23, Receiveddate is of string datatype.
In Sql query datatype is datetime.
In the Activity Execute Non Query, while providing Insert query there in parameters I provided datatype as string .
So can any one please explain how can I change the ‘string’ datatype to ‘datetime’ datatype,
Datatype I cant change in the sql because it is refelecting for other cases also.

Hi @Chippy_Kolot

Try this

DateTime.ParseExact(yourString, "yyyy-MM-dd", CultureInfo.InvariantCulture)

Hi,

Thanks

Hi @Chippy_Kolot

Try this:
DateTime.ParseExact(“16-jun-23”,“d-MMM-yy”,System.Globalization.CultureInfo.InvariantCulture)

Hope it helps.

@Chippy_Kolot

Try this

DateTime.Parse(InputString)

image

I hope it helps!!

@Chippy_Kolot

If you find the solution for your issue. Please, mark as solution to close the loop.

Regards,