-
-
Save pca2/8baeda4d4485689b4077095ffce430a3 to your computer and use it in GitHub Desktop.
Converts a python datetime to a crontab expression which fires once (at the date+time specified in the python datetime object)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime | |
def datetime_to_cron(dt): | |
return f"{dt.minute} {dt.hour} {dt.day} {dt.month} *" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment