timedelta

A datetime value representing a length of time, such as timedelta(days=7), which you add to or subtract from dates.

In more detail

Subtracting one date from another gives a timedelta, whose .days attribute and total_seconds() method report its size. It can hold days, seconds and microseconds, including negative lengths.

Example

from datetime import date, timedelta
date.today() + timedelta(days=30)

Related terms

Taught in

References