1df['DataFrame Column'] = pd.to_datetime(df['DataFrame Column'], format=specify your format)
2
3#Example
4import pandas as pd
5
6values = {'dates': [20190902,20190913,20190921],
7 'status': ['Opened','Opened','Closed']
8 }
9
10df = pd.DataFrame(values, columns = ['dates','status'])
11
12df['dates'] = pd.to_datetime(df['dates'], format='%Y%m%d')
13
14print (df)
15print (df.dtypes)
16
1# convert the 'Date' column to datetime format
2df['Date']= pd.to_datetime(df['Date'])
3
4# Check the format of 'Date' column
5df.info()