Skip to content

BUG: Series/Dataframe to_json not returning miliseconds #4362

Closed
@mariusvniekerk

Description

@mariusvniekerk

According to the documentation for pandas 0.12

date_format : type of date conversion (epoch = epoch milliseconds, iso = ISO8601)
default is epoch

The json exporting function seems to be returning the epoch nanoseconds rather than the milliseconds as suggested by the documentation.

s = pd.Series(1, index=pd.date_range('2013-07-25', periods=2, ))
s.index.astype('int64')
>> array([1374710400000000000, 1374796800000000000])

s.to_json(orient='split', date_format='epoch')
>> '{"name":null,"index":[1374710400000000000,1374796800000000000],"data":[1,1]}'

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugDocsIO JSONread_json, to_json, json_normalize

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions