Convert date format to format that will be used for MySQL insertion

Hi guys, I am trying to convert this date format dd/mm/yyy to format YYYY-MM-DD. And how do I change to date datatype? Cause I will need this datatype for database insertion.

Try with this

DateTime.ParseExact(xmlDate, "YYYY-MM-DD",

May I know why I got this error?

Remove .tostring in expression and try

Hello @hjie30

Another approach is by using the modify date activity.


.ToString is requried else error will be prompted.

(DateTime.ParseExact(xmlDate, “YYYY-MM-DD”,

I think I found where’s the error which that your answer given that you parse the source date string in wrong way, my source date format is dd/MM/yyyy and result is yyyy-MM-dd

So, I will have to use

DateTime.ParseExact(SpaDateLabel, “dd/MM/yyyy”, System.Globalization.CultureInfo.InvariantCulture).ToString(“yyyy-MM-dd”)

Thank you! that solved my issue

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