I’m having trouble when getting a Date string from a website & trying to convert it to a DateTime, it’s in UK format as I get it & when I try to parse it using Datetime.ParseExact(ClaimDate,“dd/MM/yyyy",System.Globalization.CultureInfo.InvariantCulture)
It’s returning the month as the day, so when I run it against a datetime that has day > 12 it is failing. 17/11/2018 for example. I want the conversion to happen and keep it’s current format, which I’ve provided it above. I also tried Datetime.ParseExact(ClaimDate,“dd/MM/yyyy",nothing) but the same problem is happening. Could somebody please help?
Dont use CDate, try Datetime.Parse instead. Also make clear in the beginning what is your local zone, like this. Do this Assign once in the beginning of your Process and never think about these kind of problems again:
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(“de-DE”)
Something is wrong. If you apply correct datetime.parseexact it won’t flip.
Below screenshot shows that, it is reading fine…I think you client system or the local settings is MM/dd/yyyy, so when you do datetime.parseexact is giving MM/dd/yyyy and it is not flipping.
Please share the screenshot from the workflow and the sample data?