`TomlGenerator` writes date/time values without seconds (`LocalTime.of(10, 0)` as `10:00`)

Open
#780 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@JimmyLiuJia is already working on this.

Since Oct 11, 2026.

  • #759 by @JimmyLiuJia — open

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
20/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
java
Domain
backend

Research direction

Read TomlGenerator.writePOJO() and compare its handling of LocalTime, LocalDateTime, and OffsetDateTime with the expected ISO format stated in the issue. The issue proposes PR #759, which is already open; review that work to understand the expected behavior. Done means these values include seconds when zero and remain valid for strict TOML 1.0 readers.

Written by the indexing model from the issue text.

Description

TOML

(split off from #758, item 4; found while reviewing #757; present on 3.x)

TomlGenerator.writePOJO() uses toString() for LocalTime / LocalDateTime / OffsetDateTime, which drops zero seconds: LocalTime.of(10, 0) is written as t = 10:00. TOML 1.0 requires seconds; this module's parser accepts it, but strict readers do not.

Expected: use ISO_LOCAL_TIME / ISO_LOCAL_DATE_TIME / ISO_OFFSET_DATE_TIME (or explicit patterns that always include seconds).

Proposed fix: PR #759.

Dominant language
Java
Stars
454
Forks
176
Avg merge
2d 8h
Merged PRs (30d)
16

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from FasterXML/jackson-dataformats-text

All issues in FasterXML/jackson-dataformats-text

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.