JobTimer#

class scheduler.base.job_timer.JobTimer(job_type: JobType, timing: timedelta | time | Weekday, start: datetime, skip_missing: bool = False)[source]#

Bases: object

The class provides the internal datetime.datetime calculations for a BaseJob.

Parameters:
job_typeJobType

Indicator which defines which calculations has to be used.

timingTimingJobTimerUnion

Desired execution time(s).

startdatetime.datetime

Timestamp reference from which future executions will be calculated.

skip_missingbool

If True a BaseJob will only schedule it’s newest planned execution and drop older ones.

Methods

__init__(job_type, timing, start[, skip_missing])

calc_next_exec([ref])

Generate the next execution datetime.datetime stamp.

timedelta(dt_stamp)

Get the datetime.timedelta until the execution of this Job.

Attributes

datetime

Get the datetime.datetime object for the planed execution.

calc_next_exec(ref: datetime | None = None) None[source]#

Generate the next execution datetime.datetime stamp.

Parameters:
refOptional[datetime.datetime]

Datetime reference for scheduling the next execution datetime.

property datetime: datetime#

Get the datetime.datetime object for the planed execution.

Returns:
datetime.datetime

Execution datetime.datetime stamp.

timedelta(dt_stamp: datetime) timedelta[source]#

Get the datetime.timedelta until the execution of this Job.

Parameters:
dt_stampdatetime.datetime

Time to be compared with the planned execution time to determine the time difference.

Returns:
datetime.timedelta

datetime.timedelta to the execution.