Add time to a date - Find next Monday

Hello Knime Community

Any ideas for this topic?.. For the attached set of dates I want to change all dates that are Saturday (day 7) or Sunday (day 1) to the following Monday. For instance, if the date is 2020-01-18T15:31:17 (Saturday, January 18th at 3:31 pm), I want to change it for the following Monday date at 8:30 am (Monday, January 20th at 8:20 am).

So, go from
2020-01-18T15:31:17 to 2020-01-20T08:30:00
2020-03-29T02:30:14 to 2020-03-30T08:30:00
and so on…

I’ve tried with Time Difference, Duration, Date Extractor, but I can’t find a way to do this. Any suggestions? Thanks!

Next_Week_Day.xlsx (188.0 KB)

Hi @Alejandroc,

I have built a small workflow for you that’s doing this and uploaded it to the Hub.

Hope this helps you,
Simon

2 Likes

Ah I just saw you appended a file. In this case you can replace the Table Creator with an Excel Reader node and you can remove the Extract Date&Time Fields node.

Cheers,
Simon

4 Likes

That was easy! Thanks @SimonS :+1:

2 Likes

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