Oct-10-2022, 07:31 PM
Thanks, that helped clean up the SQL part of the code, but I'm still confused on the scheduler part of the code.
So this function takes in the reminder & it's scheduled date and time, then it calls the send_reminder function but I don't get what the schedule_time.timestamp() does?
And this is what I have for getting the current date & time by the way.
So this function takes in the reminder & it's scheduled date and time, then it calls the send_reminder function but I don't get what the schedule_time.timestamp() does?
Quote:def schedule_reminder(reminder, date, time): """Schedule a reminder""" scheduled_time = date_and_time_to_datetime(date, time) schedule.enterabs(schedule_time.timestamp(), send_reminder, arguments=(reminder, scheduled_time))
And this is what I have for getting the current date & time by the way.
#-------------------------------------------------- # Current Date & Time #-------------------------------------------------- import datetime currentdate = datetime.date.today() from datetime import datetime timeNow = datetime.now() currentTime = timeNow.strftime("%I:%M %p") #--------------------------------------------------And this is what I have for my reminders:
Output:('Test 1', '2022-10-10', '4:30 PM')
('Test 2', '2022-10-10', '5:00 PM')