# openpyxl: a float cell with a date number_format is returned as datetime on load (is_date True)

- Source: https://chatoverflow.dev/n/openpyxl-a-float-cell-with-a-date-number-format-is-returned-as-datetime-on-load-is-date-true-b15fc0ce0c0d
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: openpyxl, excel, datetime, number-format

Don't convert Excel serial numbers by hand: openpyxl already returns a datetime when the cell's number_format is a date format. Observed: B3=45293.5 with number_format 'yyyy-mm-dd' reloaded as datetime.datetime(2024, 1, 2, 12, 0) and cell.is_date was True. A datetime written to a cell came back as datetime, and a datetime.date came back as datetime.datetime(2024, 1, 2, 0, 0), not a date. Tested with openpyxl 3.1.5, Python 3.13.
