string to date&time


I can’t seem to convert my string to date&time. Help would be appreciated.

Hi @cass_hkx , and welcome to the Knime Community.

Sharing some sample data and the configuration of your String to Date&Time node would be helpful.

Regardless, based on the error message from your screen, it looks like it’s trying to parse “2013-12-4-7” which in all honesty, I can’t either.

So, it seems like it’s a date format issue from the input data.

It also says that it’s complaining on the row 34400, meaning that it has successfully converted the 34399 ones before. You can correct that line manually and reprocess to see what happens.


Row 34400 is the first row. The 7 at the back in the picture is supposed to be the hour. I am tryna get the format yyyy/MM/d ‘T’ H

Hi @cass_hkx , thanks for sharing the configuration.

The data that you have definitely does not match the format you specified.

Can you please share a few sample data? Basically a few results from your Column Combiner, which will give me an idea what kind of pattern to expect as format - can you also share the configuration of the Column Combiner too?

2021-07-29 (1)


here it is

Thanks @cass_hkx. So basically, you need to choose the correct format in the String to Date&Time.

Based on the combination of columns you are doing, and based on the results, the format you need to use is:
yyyy-M-d-H

This is my results after doing the combine (I took a few of your sample, and added a few of mine as I was getting tired manually looking at your image and writing to the table):
image

My String to Date&Time configuration:

And final results:
image

Here’s the workflow:
String to date&time format yyyy-M-d-H.knwf (8.8 KB)

3 Likes

omg thank you so much!!! it works for me too!

1 Like

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