How do you make Apscheduler run at specific time from sql database #717
Unanswered
IfeOduyemi
asked this question in
Q&A
Replies: 1 comment 7 replies
-
What's the problem with that code (other than it exits right after starting the background scheduler)? |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
does anyone know how to turn sql DATETIME type into python datetime type because I want APScheduler to run at a specific time. ``` conn = sqlite3.connect('finance.db')
cursor = conn.cursor()
time_event = cursor.execute("SELECT events_time FROM events WHERE id = 28")
user_time = (" ".join(time_event))
sql_datetime_obj = datetime.datetime.strptime(user_time, "%Y-%m-%d %H:%M:%S")
conn.close()
scheduler = BackgroundScheduler(daemon=True)
scheduler.add_job(send_mail, 'date', run_date=sql_datetime_obj)
scheduler.start()
Beta Was this translation helpful? Give feedback.
All reactions