Hi all,
I’m quit new to knime and would like to create a new column with the date of the current month in the following format:
i.g. September = “09/2021”.
Can you help me with the code?
Thanks a lot
Markus
Hi all,
I’m quit new to knime and would like to create a new column with the date of the current month in the following format:
i.g. September = “09/2021”.
Can you help me with the code?
Thanks a lot
Markus
Hi @Markus3003 , first of all, just to clarify, you need the current month and also the current year, correct?
This can be done as follows:
First, I get the current date. After that, I extract the month and year using the Extract Date&Time Fields. Then I simply concatenate the month and year in the format you showed.
Results:
Alternatively, you could use use substr() to extract the month and year based on the position, however, depending on your locale setting, dates are formatted differently. That is why using the Extract Date&Time Fields is more precise (100% precise) as Knime will check this setting to do the proper extraction of the fields.
Here’s the workflow: Get current month and year.knwf (9.1 KB)
Hi Bruno,
yes correct, the current month and year.
Thank you ver much for your solution. I think that will work.
Best
Markus
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.