cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ratanapouy
Helper III
Helper III

calculate date different to make day & time

hi,

 

i am trying to make a label text in format "?? days ?? hours" from calculation two date&time

example:

Check-In: 01.08.2019 01:00 PM

Check-Out: 03.08.2019 07:00 AM

 

Output of label text: 1 day 18 hours

how to make it?

 

Thanks,

Ratana

1 ACCEPTED SOLUTION

Accepted Solutions
TheRobRush
Impactful Individual
Impactful Individual

@ratanapouyfinally made it home and made you an example app then screenshot it

 

red text is names of the various labels etc i added, means nothing just there as refeence so you understand the formulas. 

 

text boxes i surrounded in red are textual representations of the formulas in the actualy label boxes.

 

label boxes well im sure you will know which they are.

 

If you read this and dont understand it, respond and i can export the app i made as an example for you and send to you for testing and playing with the way it works on your side...

 

 

Capture.PNG

 

_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!

View solution in original post

2 REPLIES 2
TheRobRush
Impactful Individual
Impactful Individual

You will need to use rounddown() using minutes combinedwith datediff. You will then take that result which will be the number of minutes and do a rounddown of it /60. Take that result and multiply it by 60 and subtract it from the original number. That will give you leftover minutes and total hrs. Take the hrs number and use rounddown on it/24. Take that result multiply it by 24 and subtract it from the hours total and you now have leftover hrs... All three of those results together gives your days, hrs, minutes between the two. If you need it all typed out let me know. Sitting in an in n out drive through right now haha so dont have the computer to make you a working example
_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!
TheRobRush
Impactful Individual
Impactful Individual

@ratanapouyfinally made it home and made you an example app then screenshot it

 

red text is names of the various labels etc i added, means nothing just there as refeence so you understand the formulas. 

 

text boxes i surrounded in red are textual representations of the formulas in the actualy label boxes.

 

label boxes well im sure you will know which they are.

 

If you read this and dont understand it, respond and i can export the app i made as an example for you and send to you for testing and playing with the way it works on your side...

 

 

Capture.PNG

 

_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Did you miss the call? Check out the recording here!

Top Solution Authors
Top Kudoed Authors
Users online (18,270)