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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Live 'Elapsed Time Sin...
Power Apps
Unanswered

Live 'Elapsed Time Since Last Update' Field

(1) ShareShare
ReportReport
Posted on by 213

Hello, I am trying to create a field that will look at the given date/time in an adjacent field and update in real time with the time that has elapsed since that update. 

 

For this example, the time the field was last updated is "Label2_3". I would like the live updating elapsed time to be in "Label2_5". 

 

I'm assuming that I will need to use some sort of timer but not sure how to configure it to do this. 

 

Any help is greatly appreciated. 

Categories:
I have the same question (0)
  • Verified answer
    RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @JWPowder 

    Yes, a Timer!

    Place a Timer control in your app and set the duration to 1000.  Set the Repeat to be on and the Pause off and the AutoStart on.

    In the OnTimerEnd action, set the following formula:  Set(glbTime, Now())

     

    You will now have a variable in your app that you can use to determine real time.

     

    So, in your label, you can do a DataDiff function to get the elapsed duration.

    Ex.  Abs(DataDiff(DateTimeValue(Label2_3.Text), glbTime, Seconds))

    This will show the elapsed seconds.

     

    I hope this is helpful for you.

  • JWPowder Profile Picture
    213 on at

    Hello @RandyHayes, this worked with one slight modification. You typed DataDiff when I think you meant DateDiff. 

     

    This was the formula I used to return the time in a "XX Hours, XX Minutes" format:

    With({_minutes: Abs(DateDiff(DateTimeValue(Label2_29.Text), glbTime, Minutes))},
    RoundDown(_minutes/60, 0) & " Hours, " & Text(Mod(_minutes, 60), "") & " Minutes"
    )  

     

     

     

    Thank you for your help!

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @JWPowder 

    Ooops yes...DateDiff is what I meant.  Glad that worked for you.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard