Code Sample, a copy-pastable example if possible
to_excel function displays datetime types incorrectly in Excel before: datetime64[ns] - 2016-09-28 (seconds removed) after saving in excel file via - to_excel -> shows up as 2016-09-28 00:00:00 in excel (00:00:00 is added for no reason)
Expected Output
2016-09-28 in excel
output of pd.show_versions()
INSTALLED VERSIONS
commit: None python: 2.7.10.final.0 python-bits: 64 OS: Linux OS-release: 4.4.11-23.53.amzn1.x86_64 machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_US.UTF-8
pandas: 0.18.1 nose: 1.3.0 pip: 8.1.2 setuptools: 12.2 Cython: None numpy: 1.7.2 scipy: None statsmodels: None xarray: None IPython: None sphinx: None patsy: None dateutil: 2.1 pytz: 2016.4 blosc: None bottleneck: None tables: None numexpr: None matplotlib: 1.2.0 openpyxl: 2.4.0-b1 xlrd: 1.0.0 xlwt: 1.1.2 xlsxwriter: None lxml: 3.6.0 bs4: 4.4.1 html5lib: 0.9999999 httplib2: None apiclient: None sqlalchemy: 1.0.14 pymysql: None psycopg2: None jinja2: 2.7.2 boto: 2.39.0 pandas_datareader: None
Comment From: chris-b1
Note that this is just a display issue, Excel has no separate notion of a date vs datetime (generally like pandas). To specify a format, use the datetime_format
kwarg.
df.to_excel('file.xlsx', datetime_format='YYYY-MM-DD')