String to Date&Time Format

Hello Everyone,
I am struggling since several hours on a problem with the “String to Date&Time” block. My challenge is the formatting of my input to match it to the output.
This is how my input format looks like:
image

I adjusted the Date format in the “String to Date&Time” block according to my input format, but always get an error message, when I am executing the block.

I am very sure that my mistake is related to the Date format option, but tried many patterns and never got it running. Can someone help me with my mistake?

Maybe some additional words why I am doing all that.
It all starts with the following Input format (“fromDate”):
image

I used the “Cell Splitter” function to get the Day Away from the Date because when I tried to transform the “fromDate” with the “String to Date&Time” block I got an error too:

Thank you very much to everyone helping me here :slight_smile:
I wish you a nice rest of the day.
Kind regards, Alex

Hi @schalex

Welcome to the KNIME community! What error are you exactly getting?

A common resolution in cases like this is to switch to the en-US locale. If I use a sample of your data format as string and put this into a String to Date&Time node, I don’t get any error when using dd. MMM yyyy as format.

Conversion:

Your original input with the full day annotation can be parsed with EEEE, dd. MMM yyyy

image

Conversion:

2 Likes

Hello @ArjenEX ,
Thank you so much for welcoming me and giving this great advice.
You were right :slight_smile: the en-US solved the issue at the end.
After that, I only had to make d instead of dd because my dates had for the single days 4 instead of 04.

Maybe also for the next person, reading this forum and having some trouble, what helped me right now was to unselect the “Fail on error” option, to see which dates get transformed and which ones not. This showed me that the error only occurred with single digits of days.

I am really happy for the support and wish you all a good weekend.
Greetings Alex

4 Likes

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