Skip to main content
`Ctrl`+`K`

# pandas.Series.dt

Series.dt()

  Accessor object for Series values’ datetime-like, timedelta and period properties.

  This accessor provides access to properties and methods for datetime-like, timedelta, and period data types. It can be used with Series containing datetime64, timedelta64, or period data.

  Parameters:
    data Series

      Series with datetime-like, timedelta, or period dtype.

  See also

  `DatetimeIndex`

    Index of datetime64 data.

  Examples

      >>> dates = pd.Series(
      ...     ["2024-01-01", "2024-01-15", "2024-02-5"], dtype="datetime64[ns]"
      ... )
      >>> dates.dt.day
      0     1
      1    15
      2     5
      dtype: int32
      >>> dates.dt.month
      0    1
      1    1
      2    2
      dtype: int32

      >>> dates = pd.Series(
      ...     ["2024-01-01", "2024-01-15", "2024-02-5"], dtype="datetime64[ns, UTC]"
      ... )
      >>> dates.dt.day
      0     1
      1    15
      2     5
      dtype: int32
      >>> dates.dt.month
      0    1
      1    1
      2    2
      dtype: int32