How do I change the regional dates format used by studio?

Hello everyone,

I have an issue with date conversions in UiPath where my computer’s regional date format is “dd/mm/yyyy”, which works fine with every application and automation I’ve done until now, but when using the CDate function to convert a string to a date, it gives me an error as it expects a “mm/dd/yyyy” format. I’ve seen online that this function uses the local date format, which isn’t that of my computer, and I can only assume, is internal to studio. While I can just split and rearrange dates in some cases, I’d like to know if there’s a way to change the setting for studio itself ? I tried changing the language to one that uses ddmmyyyy, but the issue didn’t change at all.
Any ideas on how to do it ?

Hello @Bastien_B Instead of CDate, explicitly define the format of the string you’re parsing

DateTime.ParseExact("16/09/2025", "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture)

Cheers

Thank you for this response !
While it does work, is there no way to change studio’s locale date format itself so that CDate works as well ?

Hi,

The following may help you.

System.Globalization.CultureInfo.CurrentCulture = New System.Globalization.CultureInfo("es-ES")

Please note that this will affects not only date format but also number format etc.

Regards,

No you cannot change UiPath Studio’s internal locale so that CDate will just work with dd/MM/yyyy but you can use workflow’s culture before calling CDate but for this you have to use 2 Assign Activity at the starting and include this

System.Threading.Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo("en-GB") in 1st Assign

System.Threading.Thread.CurrentThread.CurrentUICulture = New System.Globalization.CultureInfo("en-GB") in 2nd Assign

Cheers

Thank you both for these explanations !
Since these assigns are made to system values, do they affect studio itself and therefore only need to be done once, or do they still need to be applied before the use of dates, numbers and other formats ?

These affect only the current workflow execution thread. They do not change Windows settings, UiPath Studio settings, or your machine’s locale. When the workflow execution ends then it reverse back to normal format.

Cheers

I see, thank you then !

1 Like

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