Variable (date) in file path

Hello guys,

this is my first post here as im new to uipath so i want to apologize for mistakes beforehand.
I already searched for similiar topics and i also found some useful information but nothing seems to work for me.
I want to save my word document as pdf file and while doing so i want to include a date, which i have saved in a variable, in the filepath.
This is what i have right now:
Screenshot 2021-07-02 141456
Uipath gives me an error that this path format is not supported.
Thanks for your help. :slight_smile:

Hi @kayapinar

Welcome to the UiPath Community.

Try with currentDate.ToString("ddMMyyyy")

That worked thank you so much !! i was getting so frustrated.
Can u explain what the logic behind this is ? Like why is it working now that i just specified the format of the date ?
Again thanks a lot.

currentDate.ToString will return string in this format - dd/MM/yyy or MM/dd/yyyy which contains special character '/' which is not supported by windows for naming a file.

Alternativ you might want to assign before:
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(“de-DE”)

oh yeah thas makes a lot more sense now thank you very insightful :+1:

Vielen Dank für das Feedback

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