How can calculate add 20 Days to today date?

How can ii add 20 Days to today? Or how can i calculate the difference between a date and today? I need to verify if a date is 20 days or longer than today…

Welcome to the community @Tbiyss!

That is actually more a JavaScript question and less n8n related. So you should easily find an answer if you do a Google search.

Anyway here very fast the basics:

new Date().getTime(); // Now in epoch milliseconds
new Date().getTime()+(20*24*60*60*1000); // In 20 days in epoch milliseconds
new Date('2020-08-01').getTime(); // The 1st of August in epoch milliseconds

You can use the above in an IF-Node and it will then route accordingly.

1 Like

I was trying to use setDate but I got an error the function does not exist. That was the route google put me on :slightly_smiling_face:

Thanks for support