Adding and Subtracting Columns of Time Values


I am new to Knime and studying as much as possible. Can someone tell me an easy trick to manipulate some data?

I am trying to do statistical analysis on the gaps in a time series. The data looks like Col1, Col 2…

1/10/2010, 10:21:23,
1/11/2010, 14:34:14
1/13/2010, 09:54:10
1/13/2010, 21:23:52…

My approach was to 1) add the values together into one new Column, and then 2) Subtract each row from the one before it.

I tried some of the Column nodes such as Filter and Combine, or Join, and Group by Row…but I can’t find the right answer.

The goal is to end up with one column of data that is a time value of the gap of time between Row n and Row n+1. But time needs to be in one column because the gaps continue throughout the new day at midnight.

Has anyone done this before?

Thanks in Advance,


Hi Rick,

So at first, this is a really nice idea for a future extension of our Time Difference node.

Till now, I also would suggest something similar what you are already doing.

At first, combine the two string using the string combiner.

  1. Use the Java Snippet to create the second time. The second time therefore should contain the string value, the first is having one row before.
    Global Variable
    String previous = " ";
    Method Body
    previous = $Date and time$;
    return previous;
    String ret = previous;
    previous = $Date and time$;
    return ret;

Third use 2 String to Date/Time nodes to parse your time strings to date and time values.

and at last, you can use the time difference node (option second column) to create the difference.

I hope this solution is working for your.

Best, Iris