Solved

# DateTime Difference calculation in A360

• 5 replies
• 2760 views

Hi,

I want to do some set of actions after a specific period of time when bot running.

Lets say, I’ve initiated the bot at 9:00AM on Date1: dd-MM-yyyy, the bot is running and after 120 minutes, lets say 11:00AM Date2:dd-MM-yyyy, i want do some other set of actions.

Date 1 and Date 2 are dynamic. At any point of time i want the minutes difference.

Need help on this.

### 5 replies

Userlevel 7
+13

You can use the DateTime → Subtract action for this.

If you need the number of days difference between two dates, you can use the Difference between two dates package from bot store.

Hope this will help.

+1

I think the scenario requires bit more elaborate.

When bot starts, Date1 takes system time(Current time),

The bot is running continuously or it may run for next 10 hours. But after 2 hours once i’ve to do some other actions.

Now after 120 minutes Date2 will take the system time(Current time). Now Date1 time and Date2 time has to extracted to get difference in Minutes. If it’s is 120 minutes. do some set of actions.

But Subtract Date is not dynamic right. some times date will be like 31-Dec 2022 11:00 PM to 01-Jan-2023 01:00 AM. How to handle it?

Userlevel 7
+13

I think the scenario requires bit more elaborate.

When bot starts, Date1 takes system time(Current time),

The bot is running continuously or it may run for next 10 hours. But after 2 hours once i’ve to do some other actions.

Now after 120 minutes Date2 will take the system time(Current time). Now Date1 time and Date2 time has to extracted to get difference in Minutes. If it’s is 120 minutes. do some set of actions.

But Subtract Date is not dynamic right. some times date will be like 31-Dec 2022 11:00 PM to 01-Jan-2023 01:00 AM. How to handle it?

I still can’t understand one thing here. If you are doing the action with respect to the system date, according to the scenario which you had given in the first comment, if you are running these two sets of action, the date will be always remains the same right? How can it be dynamic unless the execution passes 00:00 mark?

You just need to calculate the execution time in minutes then.

Userlevel 5
+14

@Sadanandam.G  use this package to add time munities in your case (for ex: 120 mints to trigger another task)

Userlevel 5
+9

@Sadanandam.G  use this package to add time munities in your case (for ex: 120 mints to trigger another task)

@Sadanandam.G hope you were able to use this package to solve the scenario you were trying out. Let us know if you still have any issues.