Skip to content

fix(date): support ISO-8601 with 12-hour time#9275

Open
naoNao89 wants to merge 1 commit intouutils:mainfrom
naoNao89:fix/date-iso8601-12hour-time-9253
Open

fix(date): support ISO-8601 with 12-hour time#9275
naoNao89 wants to merge 1 commit intouutils:mainfrom
naoNao89:fix/date-iso8601-12hour-time-9253

Conversation

@naoNao89
Copy link
Contributor

Fixes parsing of ISO-8601 dates with 12-hour time (e.g., 2025-01-01 12:00am).

The parse_datetime crate's combined parser only accepts 24-hour format. Workaround converts dash-separated dates to slashes when 12-hour time is detected, forcing separate parsing where am/pm is supported.

Fixes #9253

@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)

1 similar comment
@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)

@naoNao89 naoNao89 force-pushed the fix/date-iso8601-12hour-time-9253 branch from 7279fd4 to 49d348f Compare January 3, 2026 00:18
The parse_datetime crate's combined parser only accepts 24-hour
time. When parsing "YYYY-MM-DD HH:MMam/pm", it fails because the
ISO time parser doesn't support meridiem indicators.

Normalize by converting dashes to slashes (YYYY-MM-DD → YYYY/MM/DD)
which forces separate parsing where 12-hour time is supported.

Implementation uses zero-allocation string slicing for efficiency.

Fixes uutils#9253
@naoNao89 naoNao89 force-pushed the fix/date-iso8601-12hour-time-9253 branch from 49d348f to ad73e7a Compare January 3, 2026 00:29
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.

iso-8601-style date with 12-hour time does not parse

1 participant