String to Date Time

Hello,

I am trying to change some data in a CSV file from a string to a date or date time.
image
When I use the String to Date&Time node, I am having some issues. Here’s what that node looks like.


When I try to hit the Guess data type and format, it tells me there is no suitable format found.

Any help would be appreciated!

Hi there,
I think we can text edit the “Date format” value above to “dd/MM/yyyy HH:mm:ss” and click on apply, rather than clicking the Guess (since the required format is not in available list). Hope that helps!

1 Like

Hi there! Yes, I’ve edited my own formats for this, but I am getting a parsing error.

Problems in 80557 rows. First error: Could not parse date in cell [Row0, column “START_DATE”, row 1]: Text ‘28/06/2024 00:00:00’ could not be parsed at index 0.

RowID | … | ORGANIZATION | START_DATE | DEPT_LINE ----------------------------------------------------------- Row0 | … | PRD:MOX | 28/06/2024 … | 12101 ^^^^^^^^^^^^^^^ Could not parse date in cell [Row0, column “START_DATE”, row 1]: Text ‘28/06/2024 00:00:00’ could not be parsed at index 0.

Potential resolutions:

  • Change the date and time pattern to match all provided strings.

Hello @Jwideman,

You can use the date format “dd/MM/yyyy HH:mm:ss”.

It’s working.

For your reference, I have attached an image of the configuration settings and output.

Output:

5 Likes

Also one fix would be trying to restart Knime as I realized its processor usually generates Lags after being opened for a while as I faced a similar issue not too long ago

Thank you for your answer! I am trying to get MM/dd/yyyy format. I have confirmed with the end user that the time stamp is not needed. Are you able to get that format to work? I appriecate your help!

Hello @Jwideman,

To achieve the format ‘MM/dd/yyyy’, you can utilize the ‘Date&Time to String’ node.
You can find node ifrom following link:

Output:

1 Like

Hi @tqAkshay95, Even if the date is coming in as a string? In my initial post is how the data is coming into the workflow.
image

@Jwideman

First, you will convert the string to date and time, and then use the date and time to string node to achieve this result.

3 Likes

@Jwideman ,

if you have got the solution, please mark it with a green tick.

1 Like

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