Days between two dates

Hello Everyone I want to retrieve the number of days between two dates. Can anyone help describe the microflow for this. I would like to know how to use below function calls.
3 answers

You can use the daysBetween function to set a variable or set an attribute in an entity.

For example, if you  had an entity called $Entity with attributes Date1 and Date2, and you wanted to create a variable based on that number of days between the two attributes, you’d use the following in the Create Variable action.

daysBetween($Entity/Date1, $Entity/Date2)

This returns a decimal, so you need to use either round, floor, or ceil to turn this into an integer.

Hope this helps.


I am not sure what do you mean with “the microflow for this”, but you can create a local varaible as eg. integer and use the function in the create variable action:

daysBetween($YourDate1, $YourtDate2)

Both values needs to be of type datetime.



Thanks Robert and Gerrit.

I am getting an error "An action with side effects is not allowed in a microflow because it is used as the source of an attribute”. Please help me figure out whats wrong.