Temporal#

The following methods are available under the Series.dt attribute.

Series.dt.cast_time_unit(tu)

Cast the underlying data to another time unit.

Series.dt.cast_time_zone(tz)

Cast time zone for a Series of type Datetime.

Series.dt.day()

Extract the day from the underlying date representation.

Series.dt.days()

Extract the days from a Duration type.

Series.dt.epoch([tu])

Get the time passed since the Unix EPOCH in the give time unit.

Series.dt.hour()

Extract the hour from the underlying DateTime representation.

Series.dt.hours()

Extract the hours from a Duration type.

Series.dt.iso_year()

Extract ISO year from underlying Date representation.

Series.dt.max()

Return maximum as python DateTime.

Series.dt.mean()

Return mean as python DateTime.

Series.dt.median()

Return median as python DateTime.

Series.dt.microsecond()

Extract the microseconds from the underlying DateTime representation.

Series.dt.microseconds()

Extract the microseconds from a Duration type.

Series.dt.millisecond()

Extract the milliseconds from the underlying DateTime representation.

Series.dt.milliseconds()

Extract the milliseconds from a Duration type.

Series.dt.min()

Return minimum as python DateTime.

Series.dt.minute()

Extract the minutes from the underlying DateTime representation.

Series.dt.minutes()

Extract the minutes from a Duration type.

Series.dt.month()

Extract the month from the underlying date representation.

Series.dt.nanosecond()

Extract the nanoseconds from the underlying DateTime representation.

Series.dt.nanoseconds()

Extract the nanoseconds from a Duration type.

Series.dt.offset_by(by)

Offset this date by a relative time offset.

Series.dt.ordinal_day()

Extract ordinal day from underlying date representation.

Series.dt.quarter()

Extract quarter from underlying Date representation.

Series.dt.round(every[, offset])

Divide the date/ datetime range into buckets.

Series.dt.second([fractional])

Extract seconds from underlying DateTime representation.

Series.dt.seconds()

Extract the seconds from a Duration type.

Series.dt.strftime(fmt)

Format Date/datetime with a formatting rule.

Series.dt.timestamp([tu])

Return a timestamp in the given time unit.

Series.dt.truncate(every[, offset])

Divide the date/ datetime range into buckets.

Series.dt.tz_localize(tz)

Localize tz-naive Datetime Series to tz-aware Datetime Series.

Series.dt.week()

Extract the week from the underlying date representation.

Series.dt.weekday()

Extract the week day from the underlying date representation.

Series.dt.with_time_unit(tu)

Set time unit a Series of dtype Datetime or Duration.

Series.dt.with_time_zone(tz)

Set time zone a Series of type Datetime.

Series.dt.year()

Extract the year from the underlying date representation.