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

calculate hours between two dates in text format

Like (0) ShareShare
ReportReport
Posted on 2 Apr 2022 08:28:54 by

Hi everybody. I need to calculate hours between two dates from a text label. What i tried is giving me 6 hours as a result.

Here´s what i spect: 

StartDate: 20/02/2022 23:00

EndDate:  21/02/2022 04:30

Total Hours: 5 hours

 

This is what i tried:

"Total Hours: " & DateDiff(DateTimeValue(start_date_label.Text); DateTimeValue(end_date_label.Text);Hours)

Any help will be much appreciated. 

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    on 05 Apr 2022 at 04:52:09
    Re: calculate hours between two dates in text format

    Hi @madcoderz,

    Here is what I achieve on my side:

    vqiaqimsft_0-1649134272143.png

    vqiaqimsft_1-1649134288599.png

     

    I will suggest you use a Date time picker to display date time value.

Helpful resources

Quick Links

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

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!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete