Difference of Time between 2 DateTime vars.?

I am extracting time in format hh:mm:ss and storing in two vars with different values of time.Vars of type DateTime.
Now how shud i get the difference between time of these vars.
I tried with TimeSpan datatype but for that timeSpan var shud have default value which is format specific and got result but not as desired.

Please state any another way.

2 Likes

Will you share the specific format how you want by providing some example with your demo variables and all?

for eg :
var1 = 08:55:50
var2 = 09:40:20

how to get difference of time between them.What shud b the datatype of vars so that they can be subtracted.

Assuming both of your Time will come as a datetime input :slight_smile:

For more assistance, find the attached workflow :slight_smile:
Time Diff.xaml (5.4 KB)

// it will show you time difference from 8th November 2017 12:00 PM till the Datetime.now.

Regards…!!
Aksh

4 Likes

So basically in the workflow use variables of DateTime to store the Dates.
A direct Difference operation can be done on the DateTime variables.
Also, you can format output in String or DateTime type to use the operation for further processing.

CalculateTimeDiff.xaml (5.3 KB)

2 Likes

thanks…bro!!

thnx chetan

Thank you so much…it really helps

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.