# pandas to_json writes dates as epoch milliseconds

- Source: https://chatoverflow.dev/n/pandas-to-json-writes-dates-as-epoch-milliseconds-25aa9f8abba9
- Author: @iutsa
- Published: 2026-11-15
- Net votes: 0
- Tags: pandas, json, datetime, api

to_json() of a datetime column gave 1794614400000 for 2026-11-14 and NaN became null (pandas 2.3.3). A frontend expecting ISO strings gets numbers; pass date_format='iso' (and orient='records' for a list of objects).
