You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
touch: read -d dates in the local zone and honor their offsets - #15292
touch -d read a date without an offset, such as 2026-08-01 12:00:00, as UTC. It now reads it in the system zone, as the documentation describes.
This also changes dates that have an offset. The offset used to be dropped, so 2004-01-16 12:00 +0200 was set to 12:00 UTC. It now honors the offset and sets 10:00 UTC. test_touch_set_date7 has its expected value updated to match.
Integration tests set TZ to a non-UTC zone and check fixed timestamps for both forms. Run locally on Windows only. Six symlink tests fail there for a privilege reason, unrelated to this change.
jay23606
changed the title
touch: read a date without an offset in the local zone
touch: read -d dates in the local zone and honor their offsets
Oct 13, 2026
Reject nonexistent DST times consistently regardless of minute format
src/uu/touch/src/touch.rs:885
Include %Y-%m-%d %H:%M in this guard and add a regression test: with TZ=EST+5EDT,M3.2.0/2,M11.1.0/2, -d '2020-03-08 02:30' bypasses the gap check and reaches the normalizing fallback, while the equivalent input ending in :00 is rejected.
Merging this PR will degrade performance by 17.48%
⚠️120 benchmarks spent significant time in system calls
System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.
The flamegraph could not be generated because too much time was spent in runtime internals, making the visualization not useful for performance analysis.
Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.
No successful run was found on main (b77b664) during the generation of this report, so 5fda18e was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩
touch -d read "YYYY-MM-DD HH:MM:SS" as UTC. GNU touch reads it as local
time. Use the system zone for the formats that carry no offset. Adds a
unit test that fails on the UTC behaviour.
The unit tests compared against the system zone, which is UTC on UTC CI
hosts, so they passed without the local-zone behavior. Move the coverage
to integration tests that set TZ to a non-UTC zone and check fixed epochs.
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
parse_datetime normalizes a wall-clock time the zone skipped, so -d read
02:30 on a spring-forward day as a real time. Refuse it before the
fallback, as the date utility does, and cover it with a -d test.
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
parse_datetime accepts 'YYYY-MM-DD HH:MM' and normalizes a time the zone
skipped, while the seconds forms were already refused. Check the minute-only
form too, with a regression test.
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
The reason will be displayed to describe this comment to others. Learn more.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
A wall-clock time that happens twice, such as 01:30 on the autumn
fall-back day, was rejected by every local-time conversion because
`unambiguous()` fails for folds as well as gaps. `touch -t 202011010130`
therefore reported an invalid date format.
Add zoned_earlier, which takes the earlier instant for a fold and still
rejects a gap. Use it at each local-time conversion, and compute the
system time zone once in is_system_zone_gap.
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Signed-off-by: jay23606 <4602056+jay23606@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
touch -dread a date without an offset, such as2026-08-01 12:00:00, as UTC. It now reads it in the system zone, as the documentation describes.This also changes dates that have an offset. The offset used to be dropped, so
2004-01-16 12:00 +0200was set to 12:00 UTC. It now honors the offset and sets 10:00 UTC.test_touch_set_date7has its expected value updated to match.Closes #15291
Integration tests set
TZto a non-UTC zone and check fixed timestamps for both forms. Run locally on Windows only. Six symlink tests fail there for a privilege reason, unrelated to this change.