passing dates variable to time generator

Good afternoon,
I want the time generator to create all the dates between a start date and an end date dynamically (with start and end dates coming from variables).
image

When I enter inside node configuration I see there is no way to assign a variable for the start and the end date (while I can assign a variable to input the number of rows to be created).

image

Any suggestion?

Hi @vstefano ,

the values “time” for the starting and end point are the variables you are looking for… just in the wrong format.

Both are in the UNIX format (1970-01-01 is 0), meaning that if you want to use variables in your data generation node, you’ll need to convert your dates variables in the UNIX format. To do it, you can use a Date&Time difference node as described in this post.

Here is a small workflow to show what I’ve done, hope it helps.

Have a nice evening,
Raffaello Barri
Let’s connect on LinkedIn!

3 Likes

Hi Raffaello,
thanks. I cannot see the Column expression node since I have a different version of knime.
However thanks to your suggestion I was able to convert the date to unix format and it worked.
The only thing that is a little bit tricky is that I was forced to generate the date “01-01-1970” in order to create a positive Long number in the new start and end date. Otherwise the long number was negative and when I multiplied it by -1, it was converted to a double.
image
image

Thanks a lot,
Stefano

1 Like

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