Background Tasks triggered by current date and time

Have you tried starting a background task with something like this?

print('waiting for the right time...')
time.sleep((task_time - datetime.datetime.now()).seconds)
print('the time has arrived!')
do_the_job()

I wouldn’t trust it to manage delays of days or weeks, but it should work just fine with hours.