Skip to content

to_json converts to UTC when encoding ISO formatted datetimes #12997

Open
@Komnomnomnom

Description

@Komnomnomnom

Code Sample


In [99]: ts = Timestamp('2013-01-10 00:00:00-0500', tz='US/Eastern')

In [100]: pd.io.json.dumps(ts, iso_dates=True)
Out[100]: '"2013-01-10T05:00:00.000Z"'

Expected Output

In [100]: pd.io.json.dumps(ts, iso_dates=True)
Out[100]: '"2013-01-10T00:00:00.000-05:00"'

cf

In [109]: ts.isoformat()
Out[109]: '2013-01-10T00:00:00-05:00'

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIO JSONread_json, to_json, json_normalizeTimezonesTimezone data dtype

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions