pandas.Timedelta.days#

Timedelta.days#

Returns the days of the timedelta.

The days attribute of a pandas.Timedelta object provides the number of days represented by the Timedelta. This is useful for extracting the day component from a Timedelta that may also include hours, minutes, seconds, and smaller time units. This attribute simplifies the process of working with durations where only the day component is of interest.

Returns:
int

See also

Timedelta.seconds

Returns the seconds component of the timedelta.

Timedelta.microseconds

Returns the microseconds component of the timedelta.

Timedelta.total_seconds

Returns the total duration in seconds.

Examples

>>> td = pd.Timedelta(1, "d")
>>> td.days
1
>>> td = pd.Timedelta('4 min 3 us 42 ns')
>>> td.days
0