convert String to Date

Hello,
I am having problems with converting strings to dates. I am using KNIME 4.6.3.

image

The node does not recognize my date format which is like this: 30-OCT-2022. I tried various formats like dd-MMM-yyyy, d-MMM-uuuu. I get an error message like this
image

I think it either doesn’t like the hyphens or it doesn’t recognize JUN as a month.

Thank you for any suggestions.
Anne

Hi Anne!

I tried this myself, and for the string to properly convert to a date, I had to make sure the month (JUN, OCT, etc) was in Titlecase where the first letter was capitalized, then the rest are lowercase.
Then in the date format I used was dd-MMM-yyyy.

Below is a workflow example I created.
Essentially I used the cell splitter and string manipulation nodes to properly transform the month to the proper case.

StringToDate.knwf (9.5 KB)

Best,
Kyle

3 Likes

Thank you for your help.

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