Tranform String date to DateTime Variable in French Format "dd/MM/yyy"

Hello,

First of all, thank you for your help

I am facing a problem dealing with date Format in UiPath. I have checked all topics about it in the forum but i did not find a clear solution.

Indeed, let’s suppose i have a string variable for example “31/12/2019” in a french culture format which is “dd/MM/yyyy”

I want to transform this string as dateTime variable using DateTime.parseExact Methode. However when i try this, it Always converts the date into US date format as “MM/dd/yyyy” so the output is “12/31/2019”

Can you help to transform my string into dateTime variable but in a french format.

I tried :

String Date <== “31/12/2019”
Culture <== new system.Globalization.CultureInfo(“fr-FR”)
DateTime.ParseExact(Date,“dd/MM/yyyy”, culture)

It stills output “12/31/2019”

Thanks

@Mehdi_Hammou
don’t let you too much confuse from internal representations. Have a look here:
grafik

Last line the date String that is used
First Line the parsing
Second Line retrieving explicit the day part
Third Line the second proof when converted to String

2 Likes