I have a SharePoint column called "ExpirationDate." My workflow counts the days to the date. Everything seems to work except the positive results appear to be off by a day. I thought I understood that because I just figured the end date wasn't counted, but when I get the same result (0) on two different dates . . . I just don't understand the math.
Here is my expression:
div(sub(ticks(items('Apply_to_each_item')['ExpirationDate']),ticks(utcNow())),864000000000)
Today is 7/6/2022 and I get the following results for each expiration date:
ExpirationDate 7/5/22 results in -1 days (perfect)
ExpirationDate 7/6/22 results in 0 days (perfect)
ExpirationDate 7/7/22 also results in 0 days (Huh? 0 twice? Should be 1.)
ExpirationDate 7/8/22 results in 1 day (should be 2 and so on)
How can two different dates result in the same value using the exact same math function? I can't even add a condition that if the result is greater than or equal to 0 then subtract a day because I get 0 on two different days.
Can someone please help me with the math here before my brain explodes?