Reminder of date comparisons
The code below is checking whether to run something or not. It should be active until the until date has expired. The until date is supplied in configuration in DD/MM/YY format. The comparison is made by changing current date and the supplied date into Julian day format and then it’s easy to do a simple comparison.
import datetime
currday = datetime.datetime.now().strftime("%Y%j")
print("today=",currday)
until = datetime.datetime.strptime("14/12/23","%d/%m/%y")
untilday = until.strftime("%Y%j")
print("until=",untilday)
if currday <= untilday :
print("active")
else:
print("inactive")