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
Level 10

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

Level: Powered On

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?

Level 10

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)

Level: Powered On

Basic function... Should be there!

Level: Powered On

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