cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ultrAslan
Helper I
Helper I

Calculate DateTime with results in same DateTime format

Hello!

for my flow I need the difference of two Outlook calendar timestamps to add/subtract to another timestamp. The results then in the same time format.

To calculate the time difference I use

div(div(mul(sub(outputs('CalendarItemA'),outputs('CalendarItemB')),100),1000000000),60)

This gives me the time difference in minutes.
How can I now subtract this from a CalendarItemC or add to that?

 

Could it be possible to fulfill the requirements by calculating this way:

addToTime('1000-12-30T00:00:00Z',outputs('Difference),'Minutes','yyyy-MM-ddTHH:mm:ssZ'

while Difference is the result of the sub-action above.

 

Thank you for any help!

2 REPLIES 2
ultrAslan
Helper I
Helper I

Could it be possible to fulfill the requirements by calculating this way:

addToTime('1000-12-30T00:00:00Z',outputs('Difference),'Minutes','yyyy-MM-ddTHH:mm:ssZ'

while Difference is the result of the sub-action above.


Sundeep_Malik
Community Champion
Community Champion

Hey @ultrAslan 

 

you can use

addMinutes function for this.

 

Default expression:

 

addMinutes(timestamp, minute to add or subtract, optional: format date time)

 

For adding minutes use:

 

addMinutes(outputs('CalendarItemC'),outputs('TimeDiff'))

 

For Subtracting just use a negative sign in the above expression:

 

addMinutes(outputs('CalendarItemC'),-outputs('TimeDiff'))

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (1,696)