Skip to content

Conversation

naoNao89
Copy link
Contributor

@naoNao89 naoNao89 commented Oct 8, 2025

Fixes #8754

Problem

The date command fails with "invalid date" when parsing large second values with nanoseconds:

# Before - fails $ date -d "12345.123456789 seconds ago" +"%s.%N" 1759894374.858517789
renovate bot and others added 2 commits October 4, 2025 16:44
Fixes uutils#8754 parse_datetime 0.13.0 fixes the bug where parsing large second values like "12345.123456789 seconds ago" would fail with "invalid date". However, parse_datetime 0.13.0 introduced a breaking API change: - Old (0.11.0): Returns chrono::DateTime - New (0.13.0): Returns jiff::Zoned This commit adapts both date and touch utilities to work with the new API: date.rs changes: - Simplified parse_date() to directly return jiff::Zoned - Removed unnecessary chrono -> jiff conversion code - parse_datetime now returns the exact type date utility uses - Added detailed comments explaining the API change and issue uutils#8754 touch.rs changes: - Added jiff::Zoned -> chrono::DateTime conversion in parse_date() - Changed from parse_datetime_at_date to parse_datetime - Marked ref_time parameter as unused (preserved for future use) - Added detailed comments about API change and future migration path Note: 3 integration tests fail due to timezone handling changes in parse_datetime 0.13. These are separate issues that will be addressed in follow-up commits.
@naoNao89 naoNao89 force-pushed the fix-parse-datetime-update branch from e1d88e3 to 4340913 Compare October 8, 2025 06:46
Copy link

github-actions bot commented Oct 8, 2025

GNU testsuite comparison:

GNU test failed: tests/touch/relative. tests/touch/relative is passing on 'main'. Maybe you have to rebase? Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch) Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch) Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch) Congrats! The gnu test tests/date/date-tz is no longer failing! 
@naoNao89 naoNao89 force-pushed the fix-parse-datetime-update branch 2 times, most recently from 3371f17 to 3e1d11c Compare October 15, 2025 02:32
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch) Congrats! The gnu test tests/date/date-tz is no longer failing! 
@naoNao89 naoNao89 force-pushed the fix-parse-datetime-update branch from 3e1d11c to da6ede1 Compare October 15, 2025 03:26
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch) Congrats! The gnu test tests/date/date-tz is no longer failing! 
…ates The previous implementation incorrectly used parse_datetime() instead of parse_datetime_at_date(), causing relative date strings like 'yesterday' or '2 days ago' to be calculated from the current system time instead of the caller-specified reference time. This fix: - Uses parse_datetime_at_date() with proper chrono->jiff->chrono conversions - Restores deterministic behavior for relative date parsing - Adds jiff 0.2.15 as direct dependency (not workspace) to avoid feature conflicts - Ensures tests/touch/relative passes in CI Note on jiff dependency: parse_datetime 0.13 depends on jiff ^0.2.15 with specific features. Adding jiff via workspace dependency causes feature unification conflicts across platforms. Using a direct dependency with version 0.2.15 resolves this while maintaining compatibility with parse_datetime's requirements.
@naoNao89 naoNao89 force-pushed the fix-parse-datetime-update branch from da6ede1 to d55a0ee Compare October 15, 2025 06:55
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch) Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch) Congrats! The gnu test tests/date/date-tz is no longer failing! 
@naoNao89 naoNao89 marked this pull request as draft October 16, 2025 02:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant