xxxxxxxxxx
# First, let’s create a dummy DateFrame and parse DoB to datetime.
df = pd.DataFrame({'name': ['Tom', 'Andy', 'Lucas'],
'DoB': ['08-05-1997', '04-28-1996', '12-16-1995']})
df['DoB'] = pd.to_datetime(df['DoB'])
# Create a new column with formatted date using strftime() method
formatted_df = df["Date"].dt.strftime("%m/%d/%y")
# And to get year, month, and day
df['year']= df['DoB'].dt.year
df['month']= df['DoB'].dt.month
df['day']= df['DoB'].dt.day