web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Date difference between 2 dates in minutes

(0) ShareShare
ReportReport
Posted on by 21

Hello,

 

I have a column of "SLA1 Time" in list and this time is stored in a list when approver approves the task. I want to calculate the difference between "SLA1 Time" and "when item is created" and stored this difference in another column named "SLA". how can I do this. Kindly help me. 

 

Capture.JPG

I have the same question (0)
  • fchopo Profile Picture
    8,001 Moderator on at
    Re: Date difference between 2 dates in minutes

    Hello @mirtiza 

    Please, have a look at this thread: https://powerusers.microsoft.com/t5/Building-Power-Apps/how-to-get-difference-between-two-dates-in-flow/td-p/283186 where @v-xida-msft posted and excellent solution.

    Basically you can use the ticks function to get the number of ticks of a datetime value, for example:

    ticks(triggerBody()?['Created'])

     And then, calculate the difference between to two columns like this:

    div(div(mul(sub(outputs('EndTimeTickValue'),outputs('StartTimeTickValue')),100),1000000000),60)

     Where StartTimeTickValue and EndTimeTickValue are the variables where you stored your times (item created and SLA1 time).

    Hope it helps!

    Ferran

  • mirtiza Profile Picture
    21 on at
    Re: Date difference between 2 dates in minutes

    Hi @fchopo 

     

    Thanks for replying, Here is my flow

     

    3.JPG

     

    I tried this solution i am having this error.

    1.JPG

     

     

    2.JPG

     

  • fchopo Profile Picture
    8,001 Moderator on at
    Re: Date difference between 2 dates in minutes

    Hello @mirtiza 

    It seems you are trying to update a DateTime column with a string value. Is the SLA column an integer or string one?

    Hope it helps!

    Ferran

  • Verified answer
    v-alzhan-msft Profile Picture
    on at
    Re: Date difference between 2 dates in minutes

    Hi @mirtiza ,

     

    Could you please share a screenshot of the configuration of the Update item 7 action?

    I don't see the SLA column in your Update item7, what is the type of the SLA column?

    Does the Updated item 7 action failed for the SLA column? or failed for the SLA1 Time column? Could you please share the full error message for the Update item 7 action?

     

    I'm afraid that you have update the SLA1 Time column with the ticks expression so the Update item 7 run failed, please make sure that you have updated the SLA1 Time column with the time instead of the ticks expression.

     

    Best regards,

    Alice       

     

    Community Support Team _ Alice Zhang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 691 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 431 Moderator

#3
developerAJ Profile Picture

developerAJ 266

Last 30 days Overall leaderboard