String to DateTime - Error! No suitable format found!

Hi guys,

I am trying to use the string to datetime node to convert the string to datetime format. But unfortunately there was no suitable format for my datetime format.

Is there by any way anyone can show me how to write Java snippet to actually convert this to KNIME acceptable datetime format and another Java snipper to convert it back to the initial dateformat to export it out.

Hi there!

You can try manipulating your OrderDate column using String Manipulation node to get format acceptable for String to Date&Time node.

Br,
Ivan

Hi @vanness145

If it does not manage to guess a date format on its own, you can specify the date format manually as well.

If you could provide an example of string representation I could try to provide an example.

2 Likes

Hi!

So you can write your own patterns. Cool :slight_smile: But not so clear from node description at first…

If not mistaken, from the above print screen you can see string representation: 5-11-2018 04:14:02 PM

So this date format should do the trick:
d-MM-yyyy hh:mm:ss a

or K letter instead of h depending on hour format :wink:

Br,
Ivan

4 Likes

Thanks guys, that just worked fine…

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