BUG: DataFrame.to_json does not take into account of time zone naive Timestamps #46112
Closed
2 of 3 tasks
Labels
Bug
Duplicate Report
Duplicate issue or pull request
IO JSON
read_json, to_json, json_normalize
Timestamp
pd.Timestamp and associated methods
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
When I give a date without a time or an datetime that is time zone naïve into a dataframe, the to_json result gives UTC time zone aware instants instead of time zone naïve instants.
to_csv
does the right thing by only giving the date, and a time zone naïve instant.to_json
returns a UTC time zone aware instants for both the date and the instant.Expected Behavior
I would expect the to_json to return the following
Note the lack of time for the date and the lack of time zone designator for the instant.
Installed Versions
The text was updated successfully, but these errors were encountered: