Capturing Date / DateTime In UiPath Studio

Scenario :
Excel file name suffix with Date/DateTime .
Example : file_path=“C:******\Daily GL_” + reportdate + “.xls”

Solution :
In this scenario the “reportdate” variable is of type string which needs to be dynamic as per requirement.

Please follow the below steps :

  1. Add an assign activity and assign the value to reportdate variable .
  2. To get Today’s date use “Now.ToString(ddMMyyyy)” . This will get the day (03), month (04), year (2018) .
  3. If you have hours , minutes and second’s also included in the file name you can use the various options . Ex: “Now.ToString(ddMMyyyyhhmmss)”

Please follow the below link for more custom format we can achieve with the Date .

The updated workflow will look similar to below :