in Jackson JavaTimeModule
java time
objects are converted to timestamps in the for of 1421261297.356000000
, where the integer part is the number of seconds and the decimal part the number of nanoseconds of an Instant
.
I want to convert this back to a ZonedDateTime
, so the first step would be to convert this timestamp string
into an Instant
, but this format is completely out of standard and thus, there isn't any java.time
method (that I know of) to convert 1421261297.356000000
to an Instant
directly (without losing the nanosecond information).
I could do some string
manipulation and extract the seconds and add the nanoseconds later, but it would be nice to not reinvent the wheel with this kind of boilerplate code, so my question is: Are there any standard ways, methods or classes, to convert a Jackson JavaTimeModule
timestamp string to an Instant
?`