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 / Hours between dates
Power Apps
Answered

Hours between dates

(0) ShareShare
ReportReport
Posted on by 135

Hi

 

It is possible calculate hours between dates? I could calculate days between dates

2016-07-14_12-32-32.png

Categories:
I have the same question (0)
  • Verified answer
    hngdev Profile Picture
    304 on at

    Assume that you already had validation, you can try this:

    DateDiff(DateTimeValue(TextBox1.Text), DateTimeValue(TextBox2.Text)) * 24 + Hour(DateTimeValue(TextBox1.Text)) -   Hour(DateTimeValue(TextBox2.Text))

  • Jamarchi Profile Picture
    135 on at

    Hi hngdev

     

    Excellent, it worked great, thank you very much

     

    Regards,

  • hngdev Profile Picture
    304 on at

    You're welcome

  • Americo2018 Profile Picture
    19 on at

    Hi

     

    Your code may be usefull for me if is there a way to exclude weekends and holidays, How could I get that?

     

    Regadrs

    Americo

  • CarlosFigueira Profile Picture
    on at

    The post at https://blogs.msdn.microsoft.com/carlosfigueira/2017/09/23/excluding-weekends-and-holidays-in-date-differences-in-powerapps/ shows how to exclude weekends and holidays from date differences in PowerApps. Take a look and see how it can apply to your case.

     

    Hope this helps!

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard