6👍
✅
The problem is that each time this code is run the default changes to the current value of today()
. That’s because you’re actually calling the function instead of passing it as a callable. Simply leave off the trailing ()
and you should be fine.
(Note that you should use datetime.date.today
, since you want a date
value, not a datetime
value.)
Source:stackexchange.com