To convert your column into a DateTime object use the function below and pass in the name of the column:

pd.to_datetime()

for example, let's say I had a table with the column date and my table is already a DataFrame object named df.

df["date"] = pd.to_datetime(df["date"])

Column date is now datetime object.

To get years of my date I can use dt accessor and chain it to my column.

df["date"].dt.year which returns another column with only the year values

df["date"].dt.month will return month number as a column

df["date"].dt.day will return day of the month

There are many many more dt.attributes which could help solve real problems involving datetime objects