How to specify date format when using pandas.to_csv?

Since version v0.13.0 (January 3, 2014) of Pandas you can use the date_format parameter of the to_csv method:

df.to_csv(filename, date_format="%Y%m%d")

Leave a Comment