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 / Calculate total time s...
Power Apps
Answered

Calculate total time spent

(1) ShareShare
ReportReport
Posted on by 1,119

Dear team,

 

wanted to ask how can i effectively use date and time fuction to calculate the difference between the below.

The start and end time as below. and i would like to show 0 days 1 hour 59 mins spent.

 

venka91_0-1720519147020.png

 

Categories:
I have the same question (0)
  • Amol-Kavnekar Profile Picture
    125 on at

    Hi @venka91 , 

    You can try this 

    With(
    {
    varTotalMinutes: DateDiff(StartDateTime, EndDateTime, Minutes),
    varDays: Floor(DateDiff(StartDateTime, EndDateTime, Minutes) / 1440),
    varHours: Floor(Mod(DateDiff(StartDateTime, EndDateTime, Minutes), 1440) / 60),
    varMinutes: Mod(DateDiff(StartDateTime, EndDateTime, Minutes), 60)
    },
    Concatenate(varDays, " days ", varHours, " hour ", varMinutes, " mins spent")
    )

    --------------

    If you this solved your request, Mark it as a Solution to enable other users find it.

     

  • venka91 Profile Picture
    1,119 on at

    Sorry, Powerapps says there is no floor function. i could find it in help section as well. Can you help

  • Amol-Kavnekar Profile Picture
    125 on at

    You can try this.

     

    With(
    {
    varTotalMinutes: DateDiff(StartDateTime, EndDateTime, Minutes),
    varDays: DateDiff(StartDateTime, EndDateTime, Minutes) \ 1440,
    varHours: (DateDiff(StartDateTime, EndDateTime, Minutes) Mod 1440) \ 60,
    varMinutes: DateDiff(StartDateTime, EndDateTime, Minutes) Mod 60
    },
    Concatenate(varDays, " days ", varHours, " hour ", varMinutes, " mins spent")
    )

     

    Regards

    Amol Kavnekar

    If this reply helped you to solve the issue, please mark the post as Accepted SolutionMarking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone.

  • mmbr1606 Profile Picture
    14,629 Super User 2026 Season 1 on at

    hey @venka91 

     

    can u try this:

    "0 days " & 
    Text(DateDiff(DateTimeValue(TextInput_StartTime.Text), DateTimeValue(TextInput_EndTime.Text), Hours), "[$-en-US]0") & 
    " hours " & 
    Text(DateDiff(DateTimeValue(TextInput_StartTime.Text), DateTimeValue(TextInput_EndTime.Text), Minutes) Mod 60, "[$-en-US]0") & 
    " mins"
    

     

    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.



    Greetings

  • rzuber Profile Picture
    552 Moderator on at
  • Verified answer
    venka91 Profile Picture
    1,119 on at

    This formula worked. But the MOD function must be on front instead of at the end. Not sure if you have tried this formula in excel as the above format of formula did not work. Changing as below worked for me.

     

    Thank you.

     

    With(
    {
    varTotalMinutes: DateDiff(StartDateTime, EndDateTime, Minutes),
    varDays: DateDiff(StartDateTime, EndDateTime, Minutes) / 1440,
    varHours: Mod(DateDiff(StartDateTime, EndDateTime, Minutes), 1440) / 60,
    varMinutes: Mod(DateDiff(StartDateTime, EndDateTime, Minutes), 60)
    },
    Concatenate(varDays, " days ", varHours, " hour ", varMinutes, " mins spent")
    )

     

     

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 505

#2
Vish WR Profile Picture

Vish WR 482

#3
WarrenBelz Profile Picture

WarrenBelz 384 Most Valuable Professional

Last 30 days Overall leaderboard