Skip to content

java.util.Date can not be serialized as long, only (non-configurable) textual #29

@gpiancastelli

Description

@gpiancastelli

I need to serialize dates in their canonical milliseconds representation; however, when an object with a java.util.Date property is serialized, the produced JSON contains dates as formatted strings, e.g. "Tue Oct 27 17:48:29 CET 2015". I checked out the documentation to see if there is some kind of feature to activate, or some kind of annotation to put on the relevant getter method, but, alas, no luck.

Is there a way to obtain the milliseconds representation for dates in Jackson Jr.?

Note that deserialization of milliseconds into java.util.Date objects work just fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions