I would like to find the day-2 date. Here is the value I used. It worked before but does not work for the last few days/week (I didn’t change anything). As you can see, the object is good but the data displayed correspond to today’s date.
Hi @julien1, I suppose this is the Date & Time node expecting a string, but your expression {{ $now.minus({days: 2}) }} would return a JS object instead. In addition to what @dickhoning has shared you could try either one of the below options:
Use an expression such as {{ $now.minus({days: 2}).toISO() }} to return a string instead of an object. The Date & Time node would then handle this correctly:
Seeing you already use Luxon in your expression, don’t use the Date & Time node at all and simply handle the formatting in your expression as well. This should work in any node, for example {{ $now.minus({days: 2}).toFormat('yyyyMMdd') }}:
All available tokens you can use in the .toFormat() method are listed here.