Skip to content

fromJSON does not decode mongo coded dates. #440

@ralmond

Description

@ralmond

Consider this code:

dt <- Sys.time()
dtl <- fromJSON(toJSON(unbox(dt),POSIXt="mongo"),FALSE)

Returns a list with a name $date and a big integer.

This can be fixed with:

as.POSIXct(dtl$'$date'/1000,origin="1970-01-01")

But it would be nice if fromJSON could note the {"$date":1234} structure and convert it back to POSIX datetime.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions