Skip to content

Timestamp with more flexibility (e.g. nanoseconds, spaces as separators)#294

Open
stjugi wants to merge 2 commits into
entur:masterfrom
stjugi:fix/TimestampWithNanoseconds
Open

Timestamp with more flexibility (e.g. nanoseconds, spaces as separators)#294
stjugi wants to merge 2 commits into
entur:masterfrom
stjugi:fix/TimestampWithNanoseconds

Conversation

@stjugi

@stjugi stjugi commented Jun 20, 2026

Copy link
Copy Markdown

The parser for time-values is more flexible to accept as well formats like:

  • time without seconds, e.g. "15:00+01:00"
  • space instead of 'T' as date/time separator
  • offset without colon, e.g. "+0100" instead of "+01:00"
  • comma instead of dot as decimal separator for fractional seconds
  • trailing IANA zone id in brackets, e.g. "+01:00[Europe/Berlin]" (as produced by ZonedDateTime.toString()). The zone id itself is stripped and not interpreted; only the offset and local fields are used.
  • date-only input (no time component at all) should default to midnight.

Error correction:

  • the parsed result must not depend on "now" (e.g. current DST offset) - it only matters that parsing succeeds and the local fields are correct, regardless of when the test is executed.

@skinkie

skinkie commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

So you now parse invalid data?

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

Successfully merging this pull request may close these issues.

2 participants