datethyme.DateTimeSpan
This is the documentation page for the DateTimeSpan class.
datethyme.DateTimeSpan
Bases: AbstractSpan[DateTime]
_start
instance-attribute
__add__
__add__(other: Date | Time | DateTime) -> DateTimeSpan
__contains__
__contains__(other) -> bool
__init__
__init__(start: DateTime, end: DateTime, name: str | None = None)
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]