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
Super User
Super User

@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
Super User
Super User

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
Super User
Super User

@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!

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (3,000)