Skip to main content
Question

Number of days between two dates. Example = (12/17/2022, 12/9/2021) = 373 days

  • December 17, 2022
  • 2 replies
  • 1357 views

Forum|alt.badge.img

How can we calculate number of days between two dates.

2 replies

Padmakumar
Premier Pathfinder | Tier 7
Forum|alt.badge.img+15
  • Premier Pathfinder | Tier 7
  • December 17, 2022

Hi @kapil.k2 ,

 

You can do either of the below 3 methods.

  • Use a calendar table in a database

or

  • Use VB/Java/python script

or 

 

Hope of this will help.


Forum|alt.badge.img+22
  • Most Valuable Pathfinder
  • December 17, 2022

Hi @kapil.k2 

  1. Use below botstore package for a simple solution.

https://botstore.automationanywhere.com/bot/automation-360-difference-between-two-dates-package

 

  1. Checkout below tutorial to import the bot package from botstore.

 

  1. Search for DifferencebetweenTwoDates package from the Actions pane
  2. 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