next_hourly_occurrence#

scheduler.util.next_hourly_occurrence(now: datetime, target_time: time) datetime[source]#

Estimate the next hourly occurrence of a given time.

Warning

Both arguments are expected to have the same tzinfo, no internal checks.

Parameters:
nowdatetime.datetime

datetime.datetime object of today

target_timedatetime.time

Desired datetime.time.

Returns:
datetime.datetime

Next datetime.datetime object with the desired time.