Skip to content

datethyme.DateTimeSpan

This is the documentation page for the DateTimeSpan class.

datethyme.DateTimeSpan

Bases: AbstractSpan[DateTime]

_end instance-attribute

_end = end

_name instance-attribute

_name = name

_start instance-attribute

_start = start

days property

days: float

end property

end: DateTime

hours property

hours: float

minutes property

minutes: float

name property

name: str

seconds property

seconds: float

span property

span: DateTimeSpan

start property

start: DateTime

__add__

__add__(other: Date | Time | DateTime) -> DateTimeSpan

__bool__

__bool__() -> bool

__contains__

__contains__(other) -> bool

__eq__

__eq__(other) -> bool

__hash__

__hash__() -> int

__init__

__init__(start: DateTime, end: DateTime, name: str | None = None)

affine_transform

affine_transform(scale_factor: float, new_start: DateTime | None = None, new_end: DateTime | None = None, min_minutes: int | float = 5) -> DateTimeSpan

contains

contains(other, include_start: bool = True, include_end: bool = True) -> bool

from_dates classmethod

from_dates(start: Date, end: Date) -> Self

gap

gap(other: DateTimeSpan, strict: bool = False) -> Union[DateTimeSpan, None]

hull

hull(other: DateTimeSpan, strict: bool = False) -> DateTimeSpan

interior_point

interior_point(alpha: float) -> DateTime

intersection

intersection(other: DateTimeSpan, strict: bool = False) -> Union[DateTimeSpan, None]

overlap

overlap(other: AbstractSpan[DateTime], strict: bool = False) -> DateTimeSpan | 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: DateTime) -> DateTimeSpan

shift_start_rigid

shift_start_rigid(new_start: DateTime) -> DateTimeSpan

snap_end_to

snap_end_to(new_end: DateTime) -> DateTimeSpan

snap_start_to

snap_start_to(new_start: DateTime) -> DateTimeSpan

split

split(cut_point: DateTime) -> tuple[DateTimeSpan, DateTimeSpan]

subdivide

subdivide()