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

Community site session details

Session Id : CtQkUqsggDIArbB6kzL08T
Power Apps - Building Power Apps
Unanswered

Convert hour to decimal value

Like (0) ShareShare
ReportReport
Posted on 24 Sep 2019 14:28:24 by

Hello, what I am trying to do is get the values from two dropdowns and make them time value type, and then get the decimal value. something like "2:30"  would be 2,5.

When I try: 

TimeValue((Dropdown1.Selected.Value & ":" & Dropdown2.Selected.Value))/1000/60/60

It gets me a plus five difference son "2:30" gives me 7,5.

Any helpo or suggestions on how to do this would be great, thanks

I have the same question (0)
  • CarlosFigueira Profile Picture
    on 24 Sep 2019 at 14:45:12
    Re: Convert hour to decimal value

    The difference you're seeing is likely due to the time zone information from your location. There are a couple of options you can use:

    • Use math directly on the values of the dropdown controls:

     

    Value(Dropdown1.Selected.Value) + Value(Dropdown2.Selected.Value) / 60

     

    • Remove the time zone offset from the time information. The TimeValue function will create a time value from the "zero" date, which is 1970-01-01, so if we remove the timezone offset from that date, you should get the value you need:
    TimeValue(("2" & ":" & "30"))/1000/60/60 - TimeZoneOffset(Date(1970,1,1))/60

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 688 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 499 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

Last 30 days Overall leaderboard