Hi everybody,
In this post is explained how to convert a Date&Time cell to traditionally UNIX timestamp using the Date&Time difference node. Nevertheless following the post I obtain a (corrected but) negative timestamp.
As it is a long type integer to convert it to the corrected positive timestamp I have to use 3 more nodes: number to string, string manipulation and string to number.
For this reason I think it would be handy to have a new feature of the Date and Time Difference node where one can set if the difference should be calculated from the Date&Time column or from the fixed Date&Time. In this way it would be possible to obtain directly a corrected positive timestamp.
Best,
Gio
Hi,
you are right, that would be a useful feature. In the meantime, you can use the Column Expression node instead of your chain of three nodes. It can handle long values and you can simply use -column("timestamp_column")
as the expression. Make sure to set the correct output type at the top!
Kind regards
Alexander
Hi there,
how about multiplying your column with -1 using Math Formula node?
Br,
Ivan
@ipazin I think the problem is that the math formula node only outputs double or int, but not long.
Thank you Alexander. I didn’t know the Column Expression node as I’m still with KNIME 3.7.1. Will pass to the 4.0 soon.
Best
Hi there @gcincilla,
Column Expressions node is available from 3.6
https://www.knime.com/whats-new-in-knime-36#column-expressions
Br,
Ivan
Ups… I didn’t realize that. Sorry.
Good to know
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.