Skip to main content
Community site session details

Community site session details

Session Id : H97A4HadgpVzqt+ltykgNd
Power Automate - Building Flows
Unanswered

Find length of time between two date/time values?

Like (0) ShareShare
ReportReport
Posted on 26 Dec 2018 16:02:04 by 1,393

In seeking a solution to this problem, I found that while an Approval's 'timeout' value accepts only static input, the timeout for a Do Until loop allows dynamic content. Therefore, to solve one of the problems (a "regular" reminder being sent after the "final" reminder), I want to calculate the amount of time between a timestamp from the SharePoint list ("Approval Deadline") and the current time (utcNow()) to use as the timeout for the 'Reminder' Do Until loop. However, I can't seem to find an appropriate expression to do that. PowerApps apparently has a "DateDiff" function, but Flow does not. I would think that this kind of calculation would be useful in a variety of situations and shouldn't be that complicated, but I'm stumped.

 

 

  • v-yamao-msft Profile Picture
    on 27 Dec 2018 at 02:43:54
    Re: Find length of time between two date/time values?

    Hi @ChadVKealey,

     

    Currently, there is no DateDiff function can be used to calculate number of days between two date. There are similar requests on Flow Ideas Forum, please vote the idea at here:

    https://powerusers.microsoft.com/t5/Flow-Ideas/Missing-Calculate-Number-of-days-between-two-Dates/idi-p/191380

    By the way, you could consider using tricks function which returns the ticks property value for a specified timestamp.

    I have made the following flow to get the number of days between two days, please check it for a reference.

    There is a date and time column LastDay in the list, when an item is created in the list, use the following function to get the difference between LastDay and Today.

    div(sub(ticks(utcNow('yyyy-MM-dd')),ticks(triggerBody()?['LastDay'])),864000000000)

     1.PNG2.PNG

    Please take a try with it.

     

    Best regards,

    Mabel

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1

Loading complete