Date and Time - Name a new created Directory with time

Hello,

i am new and i need help for creating a Directory. The Name of this Directory should be the time of today.

I get a daily email and this email includes attachements. So, now i want to save these attachements in a directory on my desktop with the name of todays date (e.g). Better how can i create a directory with date and time as name.

Is this possible in UiPath or is there any other Options?

Thanks for Helping :slight_smile:

1 Like

Hi!

If you create a variable to hold the file name or just write it straight in the activity’s property you can use ā€œDate.Nowā€ which depending on Cultural settings will output ā€œMM/DD/YYYY HH:MM:SSā€ (I’m on English US Windows). Worth mentioning you will need to use Date.Now.ToString since it’s of type DateTime.

Hope this helps!

pass this for file name:
now.tostring(ā€œddMMyyy_HHmmssā€)
if your trying different format make sure you are not including any slashes(\ /) or Colon(: )

First of all Thank you.

But can you give me an Example ? Like, how it could look like? Or how i can Create a simple directory with date, specially how the path will look like?

here you go:
in activity pane search for activity named Create Directory then in path field in property pane pass this- Environment.GetFolderPath(Environment.SpecialFolder.Desktop) &"\ " & now.tostring(ā€œMMyyy_HHmmssā€)

3 Likes

Thanks Akshay :slight_smile:

I got another question. How can i save Attachements in this directory?

Regards

Hi,

Save_Attachment.xaml (11.9 KB)

I have uploaded a Work Flow for your requirement.

Thanks

1 Like