how to convert 2 date format in one

Hi @nisha_rathi . Welcome to the KNIME forum.

You can use two String to Date&Time nodes followed by a Merge Columns node.

The first String to Date&Time node tries the date conversion using format string yyyy-MM-dd and appends a new column with suffix d1. Note the capital letters MM for month, as “mm” would be “minutes”.

Make sure Fail on Error is not ticked:

The second uses format string ‘dd-MM-yyyy’ and appends column with suffix d2:

The Column Merger then merges the two new columns d1 and d2 into a new column

After that you can use a Column Filter to tidy up

image

This will give you a date column, which is displayed by KNIME as yyyy-MM-dd format, but note that a DATE column does not have a “specific format” of its own, and is dependent on the rendering software. If you want your date column to be output in a specific format in a file, for example, you can convert it to a string in the required format using a Date&Time to String node with the format set to yyyy-MM-dd.

1 Like