question

r0909-7582 avatar image
1 Vote"
r0909-7582 asked ·

datetime difference between two dates in minutes

In my pipeline, Iam having two variables (of type string) which is holding two different datetimestamp (UTC) . I want to know the difference between these two timestamps in minutes. Is it possible in Azure data factory?

azure-data-factory
· 1
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @r0909-7582 ,


Just wanted to follow up and check if the below suggestion helped you resolve the issue . Also if case if you have a better work around or resolution please do share that with the community as it will help other community members .


Thanks & stay safe


Himanshu


0 Votes 0 ·

1 Answer

HimanshuSinhamfst-5269 avatar image
2 Votes"
HimanshuSinhamfst-5269 answered ·

Hello @r0909-7582

You can use the tick function to work around this as we do not have an inbuild function get the time difference between two variable ( in mins ) .

You can use an expression like for one of the variables :

 @string(ticks(variables('data1'))) 

and

 @string(ticks(variables('data2'))) 

for the other . Since 1 tick = 100 nanosecond .
you can use the below expression to convert to mins :

 @String(div(sub(int(variables('datediff2')),int(variables('datadiff'))),600000000))


Please do let me know how it goes .




Thanks Himanshu

Please do consider to click on "Accept Answer" and "Up-vote" on the post that helps you, as it can be beneficial to other community members







·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.