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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / substracting two 'Now(...
Power Apps
Answered

substracting two 'Now()' timestamps

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi Guys, 

 

Im trying to find out how to substract two timestamps into the format hh:mm:ss.

 

I currently use this formula wich gives me the timedifference but only in minutes:

 

timediff = DateDiff(
 TimeValue(startTime),
 TimeValue(endTime),
 Minutes

 

Kind regards,

 

Anthony

Categories:
  • WarrenBelz Profile Picture
    156,526 Most Valuable Professional on at

    Hi @Anonymous ,

    Assuming the code posted produces the minutes total you want, try this

    With(
     {
     wMinutes: 
     DateDiff(
     TimeValue(startTime),
     TimeValue(endTime),
     Minutes
     )
     },
     RoundDown(
     wMinutes / 60,
     0
     ) & ":" & Mod(
     wMinutes,
     60
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    hi @WarrenBelz 

     

    Im trying to get the timedifference in format hh:mm:ss or hh:mm would be good aswell. 

     

    Greetings,

     

    Anthony

  • Verified answer
    rizkyaditya Profile Picture
    292 on at

    Hello @Anonymous ,

     

    You can try this if you want to show the result from your timediff represented in hh:mm:ss

    Text(Time(0,0,DateDiff(TimeValue(startTime), TimeValue(endTime), Seconds)), "hh:mm:ss")

     

    I hope this helps!

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @rizkyaditya 

     

    worked like a charm!

     

    thank you very much.

  • rizkyaditya Profile Picture
    292 on at

    Hello @Anonymous ,

     

    One small note from me.

    That only works if the time difference is UNDER 24 hours.


    Because if it is more than that, the hour reading will not be accurate.

    But if in your case the time difference only ranging in minutes and under 24 hours, than that will be your solution.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @rizkyaditya ,

     

    In my case the timedif will never be over 24 hours so great solution 😄

     

    greetings,


    Anthony

  • WarrenBelz Profile Picture
    156,526 Most Valuable Professional on at

    @rizkyaditya ,

    You might give me the chance to answer the question (which had already addressed the initial post)

  • rizkyaditya Profile Picture
    292 on at

    Hello Mr. @WarrenBelz ,

     

    I apologize for the overlapping of my reply with yours.

    I believe my browser window didn't refresh properly when i opened this thread and leave it sometime before i replied it yesterday. 

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard