How to calculate next Friday at 3am?
- by Mark
How can you calculate the following Friday at 3am as a datetime object?
Clarification: i.e., the calculated date should always be greater than 7 days away, and less than or equal to 14.
Going with a slightly modified version of Mark's solution:
def next_weekday(dt=datetime.datetime.now(), time_of_day=datetime.time(hour=3), day_of_week=4):
…