Skip to main content
Answer

Determining Elapsed Time

  • November 20, 2023
  • 2 replies
  • 337 views

LoganPrice
Most Valuable Pathfinder
Forum|alt.badge.img+14

What are your best practices for determining elapsed time in Automation Anywhere?

Let’s say a bot begins at 11:30pm on December 31, 2023. The bot finishes at 4:00am on January 1, 2024. It had a total runtime of 4 hours, 30 minutes.

How would you programmatically determine the elapsed time in the bot editor using the Datetime packages?

I can make an elaborate block of code with some if/then’s and type conversions between datetime and number values.

 

But is there a simpler way?

Best answer by Aaron.Gleason

I might recommend looking at the Date and Time Utilities package on the Bot Store.

https://botstore.automationanywhere.com/bot/date-and-time-utilities-package

It has the ability to take two datetime variables and calculate the difference between the dates. It also has a “Stopwatch Start” and “Stopwatch Stop” function that might work for you.

2 replies

Aaron.Gleason
Automation Anywhere Team
Forum|alt.badge.img+14
  • Automation Anywhere Team
  • Answer
  • December 5, 2023

I might recommend looking at the Date and Time Utilities package on the Bot Store.

https://botstore.automationanywhere.com/bot/date-and-time-utilities-package

It has the ability to take two datetime variables and calculate the difference between the dates. It also has a “Stopwatch Start” and “Stopwatch Stop” function that might work for you.


LoganPrice
Most Valuable Pathfinder
Forum|alt.badge.img+14
  • Author
  • Most Valuable Pathfinder
  • December 15, 2023

Thanks for the insight @Aaron.Gleason.