1#Convert datetime column/series to hour of the day. NB: Column must be in datetime format.
2df['hour'] = df['column_name'].dt.hour
3#Convert datetime column/series to day of the week
4df['day'] = df['column_name'].dt.weekday
5#Convert datetime column/series to month
6df['month'] = df['column_name'].dt.month
7#Convert datetime column/series to year
8df['year'] = df['column_name'].dt.year
9#NB: Weekday/Month will be in int. Eg. for months, January=1, February=2...etc,