Skip to content

datethyme.TimeSpan

This is the documentation page for the TimeSpan class.

datethyme.TimeSpan

Bases: AbstractSpan[Time]

_end instance-attribute

_end = end

_name instance-attribute

_name = name

_start instance-attribute

_start = start

days property

days: float

end property

end: Time

hours property

hours: float

id property

id: str

minutes property

minutes: float

name property

name: str

seconds property

seconds: float

span property

span: TimeSpan

start property

start: Time

__bool__

__bool__() -> bool

__contains__

__contains__(other) -> bool

__eq__

__eq__(other) -> bool

__hash__

__hash__() -> int

__init__

__init__(start: Time, end: Time, name: str | None = None) -> None

affine_transform

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]

subdivide

subdivide()