Summation of two Times

Hello all, I want to get sum of two different Times (v1 + v2) , and to put that value in variable. How is that possible? Thanks in advance.

Hi @bp777
NewStrVar = TimeSpan.parse(v1).add(TimeSpan.parse(V2)). ToString

Hope this will work for you.

1 Like


first Split using ā€œ+ā€ as delimiter store in array
then split using ā€œ:ā€ as delimiter
Concatenate into V1 and V2 and add them

Use @Deepak94 solution it is very easy

@Deepak94 that looks very nice, but Iā€™m getting error : Assign: String was not recognized as a valid TimeSpan.
Even though variable testara is of type String

Hi @bp777
Have you added .ToString at the end ?

Also Make sure that V1 and V2 should be in this format 00:00:00

Yes I did @Deepak94

of which type do v1 and v2 need to be before TimeSpan.Parse?

String should be fine.