How can we calculate number of days between two dates.
Number of days between two dates. Example = (12/17/2022, 12/9/2021) = 373 days
Hi
You can do either of the below 3 methods.
- Use a calendar table in a database
or
- Use VB/Java/python script
or
- Use Difference between two dates package from bot store.
Hope of this will help.
Hi
- Use below botstore package for a simple solution.
https://botstore.automationanywhere.com/bot/automation-360-difference-between-two-dates-package
- Checkout below tutorial to import the bot package from botstore.
- Search for DifferencebetweenTwoDates package from the Actions pane
-
You can retrieve the difference between two dates in days format by using the DifferenceBetweenTwoDates: Difference between two dates in Days command and provide the First Date and Second Date as well as the Date Format. The output should be assigned to a string variable as below
![](https://uploads-us-west-2.insided.com/automationanywhere-en/attachment/d7aa77a4-e83d-4aad-88ac-ef62c0cafd13.png)
![](https://uploads-us-west-2.insided.com/automationanywhere-en/attachment/4eb94004-8f4b-4ce8-9297-eab24b1b3908.png)
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.