I am currently writing a function that will generate as hardcode today's date and the time as 23:00. For example, if today is June 1, 2022 it will be 2022-06-01T23:00. If today's date is May 14, 2022 it will be 2022-05-14T23:00. I currently only can set it to the midnight of YYYY-MM-DD-00:00:00 even I change the numbers to 23:00.
Here is my implementation:
time = datetime.date(scheduled_time).strftime("%m %d %y")
replace_time = time.replace('23', '0') //here can be 23:00
format_date = datetime.strptime(replace, "%m %d %y")
return format_date
Any clue on how to print the 23:00 part