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!

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,857)