Mess with datetime format

Hi @Karlygash , Knime is probably looking at the current century rather than the current year, and I don’t see what else it can do.

In your case, since it’s more of a log, it means that the dates cannot be in the future. Therefore, you can apply additional logic, such as if new_date > current_date then new_date = new_date - 100 years.

So, “2097-09-21” is > that current_date, then “2097-09-21” should become “2097-09-21” - 100 years = “1997-09-21”

I put something together for you based on this logic. I added these to your workflow:

And it yields these results:
image

Here’s the workflow:
datetime format for 19XXs.knwf (19.6 KB)

5 Likes