-
-
Notifications
You must be signed in to change notification settings - Fork 17.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: Series/Dataframe to_json not returning miliseconds #4362
Comments
cc @hayd I suppose this is incompatible with exportable JSON (e.g. you are writing a frame and using it somewhere else) |
Yeah the expectation would be milliseconds as that seems to be the standard time-stamp format in JSON (and JavaScript). I think it should be JSONifying in millis (or ISO) by default. Although , afaik the JSON spec says nothing about date and timestamp, so I think this is more of a convention, but in JavaScript it would be milliseconds. In JavaScript (Chrome): > new Date(1374710400000000000)
Invalid Date
> new Date(1374710400000)
Thu Jul 25 2013 10:00:00 GMT+1000 (EST)
> d = new Date(1374710400000)
Thu Jul 25 2013 10:00:00 GMT+1000 (EST)
> d.toJSON()
"2013-07-25T00:00:00.000Z"
> JSON.stringify(d)
""2013-07-25T00:00:00.000Z""
> JSON.stringify(+d)
"1374710400000" |
fyi...these can actually be fractional msecs (e.g. floats) I can do this conversion before I pass to you (e.g. I'll just pass you an int or float column), easy enough to reconvert as well (as or do you want to do it natively? only other issue is we are going to have to back-compat now (though sort of easy to figure it out) as they differe by orders of magnitude |
I'd like to have a go at doing it natively (I think it'd be more flexible that way). Right now (I think) it uses I should have some time to look at it this evening (it's morning here). |
fine by me! let me know |
closed via #4498 |
According to the documentation for pandas 0.12
The json exporting function seems to be returning the epoch nanoseconds rather than the milliseconds as suggested by the documentation.
The text was updated successfully, but these errors were encountered: