Skip to content
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

ZonedDateTime for times before the epoch do not serialize correctly #69

Closed
cowtowncoder opened this issue Apr 10, 2018 · 2 comments
Closed
Milestone

Comments

@cowtowncoder
Copy link
Member

(moved from https://github.com/FasterXML/jackson-datatype-jsr310/issues/97
reported by @twilson-palantir )

Version 2.8.10

    public static void main(String[] args) throws Exception {
        ObjectMapper mapper = new ObjectMapper().registerModule(new JavaTimeModule());
        ZonedDateTime original = ZonedDateTime.parse("1959-04-13T05:05:38.599Z");
        String serialized = mapper.writeValueAsString(original);
        ZonedDateTime deserialized = mapper.readValue(serialized, ZonedDateTime.class);
        System.out.println(original);
        System.out.println(serialized);
        System.out.println(deserialized);
    }

outputs

1959-04-13T05:05:38.599Z
-338324062.599000000
1959-04-13T05:05:37.401Z[UTC]

I haven't checked other types for issues, but I wouldn't be surprised if they were similarly broken.

@cowtowncoder cowtowncoder added 2.10 good first issue Issue that seems easy to resolve and is likely a good candidate for contributors new to project labels Aug 13, 2019
@cowtowncoder
Copy link
Member Author

Not actually sure this is "easy" per se, but I think that investigating basic problem should be straight-forward and then it should be possible to either:

  1. Add unit test to show the problem (or, if can not reproduce, close as fixed)
  2. Possibly fix, OR, if more difficult than expected, add findings

and if not easily fixable, add a failing unit test (under failing package so it won't block builds)

@cowtowncoder
Copy link
Member Author

cowtowncoder commented Aug 30, 2019

Fixed via #132, duplicates #120 -- will be in 2.10.0.pr2.
Kudos to @kupci for fix!

@cowtowncoder cowtowncoder removed the good first issue Issue that seems easy to resolve and is likely a good candidate for contributors new to project label Aug 30, 2019
@cowtowncoder cowtowncoder added this to the 2.10.0.pr2 milestone Aug 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant