Date and Time System Variables
- Dernière mise à jour2023/02/15
Date and Time System Variables
You can use the set of Date and Time system variables to insert or monitor the current date and time of the bot Player as your automation task runs.
Use Case Scenario
Using Date/Time variables can help you track and log points in time to monitor the success or error of a running process.
To view the system variables and their descriptions, follow these steps:
- In the Workbench, click the Variable Manager icon at the top or on the tab on the right side.
- Click on the "Show System Variables" link.
To insert a Date/Time system variable, follow these steps:
- In the Workbench, drag a Variable Operation command in the task pane.
- Select the System Variables radio button.
- In the drop-down menu, select the system variable that you want to insert.
- Click Save.
Manage your Date/Time variables by using the options listed in the table. The table shows Date/Time system variable names, return values, and actions.
For the Date variable, you can use the System Variables window to change the format that is returned in the Date variable. Follow these steps:
- In the Workbench, click the Variable Manager icon at the top or on the tab on the right side.
- Click on the "Show System Variables" link.
- Select the Date variable from the Date/Time list of variables and click the ... button.
- Select the date format in the Select Date Format pop-up window.
Examples:
- The following command stores the current DATE, DAY, and YEAR path in a log file.
This is important while logging of errors or certain important information on files
to include the date stamp.
- Drag and drop the Log To File command.
- Use the F2 function key to insert variables for $Date$, $Day$ and
$Year$.Command:
Log to File: Date:$Date$Day:$Day$Year:$Year$ in "C:\Variable Operation.txt"
- The following command stores the current HOUR, MINUTE, and SECONDS in a log file.
This adds the timestamp to the log for analysis.
- Drag and drop the Log To File command.
- Use the F2 function key to insert variables for $Hour$, $Minute$, and
$Seconds$.Command:
Log to File: Hour:$Hour$Minute:$Minute$Seconds:$Second$ in "C:\Variable Operation.txt"