BUG: Series/Dataframe to_json not returning miliseconds · Issue #4362 · pandas-dev/pandas (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

@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]}'