Problem with String to DateTime Node Country specific

Hi, I have a special problem converting a string to a date. I will divide the problem into two parts because, as I read, I will solve one only after upgrading from knime 4.3 to 4.4 (Problem with String to DateTime Node).
I have a string in which the date and time are encoded. Unfortunately, the date in the string has the names of the months in Italian
31-DIC-21 21: 36: 49.00000000000.

I don’t want hours or minutes or seconds (this should be solved by upgrading to 4.4), so if I separate it, I only have the date 31-DIC-21, which I want to convert to 31.12.21.

Unfortunately, the node string to date & time cannot convert 31-DIC-21.
I have to split the text and exchange the DIC for DEC and then combine it all.
The text is then converted to a date.

It is quite important for me to solve this problem, because it costs a lot of effort to constantly transform dates from different countries, this is currently Italy. I created a workflow but I’m sure there is a more elegant solution, but I don’t know how to do it.

Here is workflow KNIME_italian date format.knwf (13.6 KB)

Hi @MarekV,

You just need to use a Case Converter node and convert your month values to lower case (lowercase the whole date column) then the String to Date&Time node can parse it without any problems. This is because the month abbreviations in Italian are lowercased.

:blush:

6 Likes

Thank you it is working.
I was not aware about lowercase for Italian date.
KNIME_italian date format FIXED.knwf (25.9 KB)

2 Likes

This is interesting! :grin:

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