String to Date

I want to transform a string (Scheduled Time of Departure) into a time and I can’t do it. Can you help me?

The error you report is in the image below.

Thank you very much

Hey there and welcome to the forum,

do you mind sharing a screenshot of the configuration dialogue of string to date&tume node?

Based on the error message I expect that you will have something like HH:mm:SS in the date format field - and the node is now complaining that you don’t have seconds.

First I would try to change it to HH:mm:

example wf:

stringtotime.knwf (73.2 KB)

2 Likes

Hello, @MartinDDDD

Thank you very much for your help.

I tried changing the data format as you suggested, but it didn’t work.

I share my screenshot for your review.

I hope we can solve this problem at Knime.

Thank you very much for your support.

Best regards

Could you try to clean the string column before to the “String to Date&Time” Node? Sometimes there are special characters, New Line, Blanks in the string which aren’t displayed. You can use the “String Cleaner” Node

Don’t forget to activate “remove all whitespace” option.

1 Like

/update:
@ActionAndi - did not see your post before posting - your solution fixes it already :slight_smile:

Hi Ana,

I think I know whats happening:

There seems to be a blank space before the time. i.e. it is " 04;44" instead of “04:00”.

If you use a Column Expressions node with the strip() function in a step before, this should remove any whitespace at the beginning or end:

Example:

stringtotime.knwf (78.3 KB)