Best syntax to record time within a filename

Hi, what syntax do you guys usually use to record time within a filename?

Cos I can’t really name a file with colon as separators e.g. “17:04:55.xlsx” doesn’t work… also “17-04-55.xlsx” or “17_04_55.xlsx” looks more like date notation, “17.04.55.xlsx” the dot is also used to denote the extension


Try like below:


1 Like


actually I tried using Filename+"_"+Now.toString(“dd-MM-yy_hh-mm-ss”) but it is easy to confuse the date and the time so that’s why I’m asking here what syntax you all are using

1 Like

You can Use :
“FileName “+Now.ToLongTimeString.Replace(”:”,"_")+".xlsx"
“FileName “+Now.ToLongTimeString.Replace(”:”,"-")+".xlsx"

1 Like

Yup it is, But as a general way also we are using that only correct.

So through UiPath we do the same.

1 Like


Kindly attach tt at the end of your time string attachment like how to tried earlier…

Filename+"_"+Now.toString(“dd-MM-yy_hh-mm-ss-tt”), This usually lets you know that it implies time…AM or PM



Your solution is correct. we are also using like this way only.