df.to_excel(filename, index = False)
This is my current code for exporting data frame to an excel, column index 0 and 2 contain dates, but I need these columns to be formatted as an Excel date format. I have read online but I don't understand how to achieve this.
Can someone please explain
import pandas as pd
from datetime import datetime
writer = pd.ExcelWriter(testing.xlsx", datetime_format='dd/mm/yyyy')
hold.to_excel(writer, "Sheet1", index = False)
writer.close()
print("done")