Temporal#

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

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.replace_time_zone(time_zone, *[, ...])

Replace time zone for a Series of type Datetime.

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

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

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

Extract the days from a Duration type.

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

Extract the hours from a Duration type.

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

Roll backward to the first day of the month.

Series.dt.month_end()

Roll forward to the last day of the month.

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

Convert a Date/Time/Datetime column into a Utf8 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 Utf8 column with the given format.

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

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.convert_time_zone(time_zone)

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

Series.dt.year()

Extract the year from the underlying date representation.