Temporal#

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

Series.dt.add_business_days(n[, week_mask, ...])

Offset by n business days.

Series.dt.base_utc_offset()

Base offset from UTC.

Series.dt.cast_time_unit(time_unit)

Cast the underlying data to another time unit.

Series.dt.century()

Extract the century from underlying representation.

Series.dt.combine(time[, time_unit])

Create a naive Datetime from an existing Date/Datetime expression and a Time.

Series.dt.convert_time_zone(time_zone)

Convert to given time zone for a Series of type Datetime.

Series.dt.date()

Extract (local) date.

Series.dt.datetime()

Extract (local) datetime.

Series.dt.day()

Extract the day from the underlying date representation.

Series.dt.dst_offset()

Additional offset currently in effect (typically due to daylight saving time).

Series.dt.epoch([time_unit])

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.is_leap_year()

Determine whether the year of the underlying date representation is a leap year.

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.millennium()

Extract the millennium from underlying representation.

Series.dt.millisecond()

Extract the milliseconds from the underlying DateTime representation.

Series.dt.min()

Return minimum as Python datetime.

Series.dt.minute()

Extract the minutes from the underlying DateTime representation.

Series.dt.month()

Extract the month from the underlying date representation.

Series.dt.month_end()

Roll forward to the last day of the month.

Series.dt.month_start()

Roll backward to the first day of the month.

Series.dt.nanosecond()

Extract the nanoseconds from the underlying DateTime representation.

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.replace(*[, year, month, day, ...])

Replace time unit.

Series.dt.replace_time_zone(time_zone, *[, ...])

Replace time zone for a Series of type Datetime.

Series.dt.round(every)

Divide the date/ datetime range into buckets.

Series.dt.second(*[, fractional])

Extract seconds from underlying DateTime representation.

Series.dt.strftime(format)

Convert a Date/Time/Datetime column into a String column with the given format.

Series.dt.time()

Extract (local) time.

Series.dt.timestamp([time_unit])

Return a timestamp in the given time unit.

Series.dt.to_string([format])

Convert a Date/Time/Datetime column into a String column with the given format.

Series.dt.total_days()

Extract the total days from a Duration type.

Series.dt.total_hours()

Extract the total hours from a Duration type.

Series.dt.total_microseconds()

Extract the total microseconds from a Duration type.

Series.dt.total_milliseconds()

Extract the total milliseconds from a Duration type.

Series.dt.total_minutes()

Extract the total minutes from a Duration type.

Series.dt.total_nanoseconds()

Extract the total nanoseconds from a Duration type.

Series.dt.total_seconds()

Extract the total seconds from a Duration type.

Series.dt.truncate(every)

Divide the date/ datetime range into buckets.

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(time_unit)

Set time unit a Series of dtype Datetime or Duration.

Series.dt.year()

Extract the year from the underlying date representation.