What this thread does
Do first: on Jackson 2 register new JavaTimeModule() on the mapper that reads Instant; on Jackson 3 use its built-in Java-time support.
Short answer
As of November 2026, Jackson 2.23.0 has a separate Java 8 Date/time module; Jackson 3.3.0 is a newer release. As of Jackson 3.0.0, all three Java 8 modules are merged into jackson-databind and need not be registered (module guide, migration guide). An Instant represents a point in time, not a wall-clock time with an implicit server timezone. Supply Z or a numeric offset, then choose string versus numeric output separately.
Choose / don't choose
Instant: choose for an absolute event timestamp; its parsed string must represent a valid instant in UTC (JDK Instant).- Local timestamp contract: choose a local date/time type when the input intentionally has no offset; don't silently assume the machine's timezone turns it into a unique instant.
- Textual output: date/time is serialized as textual values rather than timestamps. Choose when clients need readable timestamps; don't confuse output-format selection with a repair for invalid input (date feature source).
Not for: migrating the whole Spring Boot stack; see spring-boot-4-upgrade-from-3-5-jackson-3-starters-openrewrite.
Settings that matter
| Setting or flag | Value / default | Applies to | Source |
|---|---|---|---|
registerModule(new JavaTimeModule()) | Register before reading/writing on the actual mapper; add matching jackson-datatype-jsr310 dependency | Jackson 2.x | module guide |
DateTimeFeature.WRITE_DATES_AS_TIMESTAMPS | false emits textual dates; already disabled by default since Jackson 3.0; explicitly disable on the builder when preserving this contract | Jackson 3.3.0 | feature source, migration |
Instant.parse / DateTimeFormatter.ISO_INSTANT | The string must represent a valid instant in UTC and is parsed using DateTimeFormatter.ISO_INSTANT; parsing converts the offset to UTC | JDK current reference | Instant, formatter |
Order of operations
1. Identify the mapper generation. Explicitly register the modules you want where separate modules are used; as of Jackson 3.0.0 the three modules are merged into jackson-databind and need not be registered (module guide). 2. Require an offset-bearing input. The formatter describes "converting the instant to UTC as necessary" (formatter). 3. Choose textual output independently. Configuration of Java 8 Date/Time handling in 3.x uses DateTimeFeature; the old Jackson 2 feature belongs to SerializationFeature (migration, source). 4. In the application's own round trip, compare the instant value, then compare output shape separately; an equivalent timestamp need not preserve the original textual offset.
Known failures and fixes
| Error (short quote) | Cause | Fix | Source |
|---|---|---|---|
Java 8 date/time type / not supported by default | The reported error says to add the Java-time module to enable handling | Register the Java-time module to enable handling | module guide, atul-X, October 21, 2023 |
DateTimeParseException | The text cannot be parsed | Use text representing a valid instant in UTC | Instant parse contract, offset parser |
Missing
- A local timestamp alone cannot identify the original timezone or daylight-saving overlap choice. Obtain that information from the producer rather than inventing it.
- Custom serializers may override defaults; inspect the mapper and field handling used by the actual application.
Checked
2026-11-12; Jackson 2.23.0/3.3.0 release notes, module/migration guides, DateTimeFeature source, JDK Instant/formatter references, and atul-X's dated issue read. No Java mapper or parser executed.
Started from a post by @FasterXML, packaged by the editor. Original post