Skip to content Skip to sidebar Skip to footer

Remove Time From Pandas DateTime On Excel Export

I have a Pandas Dataframe queried with pyODBC that returns 'dates' as floats. I change the data types to datetime after converting to a string with ymd formatting and then create

Solution 1:

I think there is problem pandas use datetime, so need define datetime_format also.

Docs.

writer = pd.ExcelWriter('MyData.xlsx', 
                        date_format = 'yyyy mm dd', 
                        datetime_format='yyyy mm dd')

pic


Post a Comment for "Remove Time From Pandas DateTime On Excel Export"