datethyme.TimeSpan
This is the documentation page for the TimeSpan class.
datethyme.TimeSpan
Bases: AbstractSpan[Time]
_start
instance-attribute
__contains__
__contains__(other) -> bool
__init__
__init__(start: Time, end: Time, name: str | None = None) -> None
affine_transform(scale_factor: float, new_start: Time | None = None, new_end: Time | None = None, min_minutes: int | float = 5) -> TimeSpan
contains
contains(other, include_start: bool = True, include_end: bool = False) -> bool
gap
gap(other: Time | TimeSpan, strict: bool = False) -> TimeSpan | None
hull
hull(other: Time | AbstractSpan[Time], strict: bool = False) -> TimeSpan
interior_point
interior_point(alpha: float) -> Time
intersection
intersection(other: TimeSpan, strict: bool = False) -> Union[TimeSpan, None]
overlap
overlap(other: AbstractSpan[Time], strict: bool = False) -> TimeSpan | None
round_hours
round_hours(round_to: int) -> Self
round_minutes
round_minutes(round_to: int) -> Self
round_seconds
round_seconds(round_to: float) -> Self
shift_end_rigid
shift_end_rigid(new_end: Time) -> TimeSpan
shift_start_rigid
shift_start_rigid(new_start: Time) -> TimeSpan
snap_end_to
snap_end_to(new_end: Time) -> TimeSpan
snap_start_to
snap_start_to(new_start: Time) -> TimeSpan
split
split(cut_point: Time) -> tuple[TimeSpan, TimeSpan]