Convert datetime difference to integer seconds

Hi everyone,

I want to get the duration (difference between 2 timestamps) in seconds (as an integer), but I’m not managing to get the variable types right.

My workflow is the following:



1 Like

is your var1 and Var2 is of type DateTime??


Hope var1 and var2 variables of type DateTime.

And then create one variable of type TimeSpan and let’s say “duration”.

Now print duration.TotalSeconds


if var1 is your DateTime variable and is equal to
var1 = 1/29/2020 05:40:06
var2 = 1/29/2020 05:55:06

then create TimeDiff var of StringVar
TimeDiff = (Var2-var1).ToString

Thanks guys!

1 Like

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