cancel
Showing results for 
Search instead for 
Did you mean: 

Datedif() function in Flow

It would be great if you could just use a formula to calculate de difference between to given dates in Flow. For a lot of common requirements this formula ends up being very useful.

Status: New
Comments
Super User

Totally agree,  while I found a suitable work around,  DateDif is a basic function in nearly all programs.  failing that the ability to sub one date from another would also enhance flow

Helper II

fmbernalb wrote:

 

It would be great if you could just use a formula to calculate de difference between to given dates in Flow. For a lot of common requirements this formula ends up being very useful.


Can I ask what your workaround is leyburn?

Super User

Hi I created three integer variables. In the first two I used the tick() function to convert the date from and date to to integers. In the third variable that subtracted the variables from each other and then divided the result by the number of ticks in a day

 

var1 named test @ticks(triggerBody()?['DateFrom'])

 

var 2 named test2 @ticks(triggerBody()?['DateTo'])

 

var 3 @div(sub(variables('Test2'),variables('Test')),864000000000)

Advocate I

Basic function... Should be there!

Frequent Visitor

Absolutely! Need the ability to be able to calculate days.

Frequent Visitor

also me

 

Regular Visitor

In the advent of WFH during covid-19, users in my organisation are looking for more ways they can be productive while out of the office. One thing WFH has caused is an abundance of meetings which can often run back-to-back and leave no time to actually action any outcomes of the meetings. My users have requested a flow that automatically creates buffer meetings directly after any meetings they accept, and this buffer meeting ideally would change duration depending on how long the original meeting is - ie for hour long meetings create a 20 minute buffer after, for shorter meetings create a 10 minute buffer. This is incredibly difficult/impossible without a datediff function, any workarounds suggested do not seem to work in this context.