cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
d4n13l74
Frequent Visitor

Calculate the difference between two hourly data

Hello, I hope you are having a good day.

I need to know which function allows me to do the following.
I need to know if two values of hour and minute have a difference of 15 minutes between them for example.

 

20:13 and 19:58 or between 15:59 and 16:14

 

Thank you very much in advance

2 ACCEPTED SOLUTIONS

Accepted Solutions
ScottShearer
Super User
Super User

@d4n13l74 

Please take another look at the post and note that the date/time strings are converted to integers using the ticks() expression.

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

Hi @d4n13l74 

Has your problem been solved?

If your problem has been solved by Scott's reply, please consider accept his reply as an answer.

I test on my side and you can refer to below screenshots.

vLilyWmsft_0-1642477062089.png

vLilyWmsft_1-1642477113763.png

Expression:

div(sub(outputs('Compose'),outputs('Compose_2')),600000000)

vLilyWmsft_2-1642477150580.png

Result

vLilyWmsft_3-1642477222071.png

Best Regards.

 

View solution in original post

5 REPLIES 5
ScottShearer
Super User
Super User

@d4n13l74 

Please see this post as it explains how to do exactly what you are trying to accomplish.

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

Thank you very much for your prompt reply. But my data comes as string and the functions explained in that post are of type integer. So I don't know how I can do this, how to convert this string date

2021-11-30T20:13:00


to date type date to be able to use this function

div(div(mul(sub(variables('Aux1'),variables('Aux2')),100),1000000000),60)
ScottShearer
Super User
Super User

@d4n13l74 

Please take another look at the post and note that the date/time strings are converted to integers using the ticks() expression.

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

Hi @d4n13l74 

Has your problem been solved?

If your problem has been solved by Scott's reply, please consider accept his reply as an answer.

I test on my side and you can refer to below screenshots.

vLilyWmsft_0-1642477062089.png

vLilyWmsft_1-1642477113763.png

Expression:

div(sub(outputs('Compose'),outputs('Compose_2')),600000000)

vLilyWmsft_2-1642477150580.png

Result

vLilyWmsft_3-1642477222071.png

Best Regards.

 

Thank you @ScottShearer  and @v-LilyW-msft . My last question, What is the formula to be able to see the difference considering the seconds? Because I have a stream that runs every 5 minutes. It ran at 23:15:33 and the other date I need to know was at 23:14:43, so it falls within the [0-5] minute difference interval. But then I run at 23:20:34 and it takes the date 24:14:43 positive again, when in fact it should no longer take it. 

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power automate tips 768x460 v2.png

Restore a Deleted Flow

Did you know that you could restore a deleted flow? Check out this helpful article.

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.

Users online (2,806)