cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sienna
Level 10

Re: Calculate flight time

@timl

Oh yes you right... Problems are with minutes. I thought the problems are with hours.. I played with that time function for a while few weeks ago and I didn't notice that. I was sure it worked as I wanted to. However I've got another solution for that. It is a bit crazy but it works so far and din't notice any problem. What I'm doing here is adding those minutes into Today() where today always return 0:00 . And then formating it to hours:minutes format. Try it and let me know if you find any problem. I think this is much more easier and cleaner then the other workaround

 

Text(DateAdd(Today(),
DateDiff(DateTimeValue("2018-01-22 23:05"),DateTimeValue("2018-01-23 12:34"),Minutes),
Minutes),
"[$-en-GB]hh:mm")

 

Sienna
Level 10

Re: Calculate flight time

However I wasn't able to pull a day from it. That means if the duration exceed 24 hours it will go back to 00:00. So I found this the only solution to retrive also days from date - time format 

 

RoundDown(Value
(DateDiff(DateTimeValue("2018-01-22 23:05"),DateTimeValue("2018-01-23 23:06"),Minutes)
/1440),
0)
&"day(s) "&
Text(DateAdd(Today(),DateDiff(DateTimeValue("2018-01-22 23:05"),DateTimeValue("2018-01-23 23:06"),Minutes),
Minutes),
"[$-en-GB]hh:mm")

I guess this is good example for new function suggestion to make it more easier and clearer

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 92 members 5,431 guests
Please welcome our newest community members: