dbader / schedule

Python job scheduling for humans.
https://schedule.readthedocs.io/
MIT License
11.73k stars 959 forks source link

How to do job once at a specific date and time? #513

Open Futyn-Maker opened 2 years ago

Futyn-Maker commented 2 years ago

Hello!

I need a Python script that executes some task once in a specific date and time? Can I do it using Schedule? In the documentation I've found such a code:

schedule.every().day.at('22:30').do(job_that_executes_once)

It works, but I need something like this:

schedule.every().day.at('2022-04-03 22:30').do(job_that_executes_once)

But this code returns an error. Can I do it in some way?

Thanks!

faulander commented 2 years ago

https://schedule.readthedocs.io/en/stable/examples.html#run-a-job-once so i would do the following: