Repository navigation
find: print -ls times in local time - #922
Conversation
The -ls date column was formatted in UTC; GNU find and -printf %t use the local time zone.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #922 +/- ##
=======================================
Coverage 92.65% 92.65%
=======================================
Files 37 37
Lines 7837 7837
Branches 393 393
=======================================
Hits 7261 7261
Misses 435 435
Partials 141 141 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merging this PR will not alter performance1 warning
Comparing |
|
Thanks for your PR |
-lsand-flsformat the modification time in UTC. GNU find,ls -land this find's own-printf %tuse the local time zone, so on any machine not in UTC the-lscolumn is off by the UTC offset:The date is now converted to
chrono::Localbefore formatting, in both the unix and the Windows-lspaths. WithTZ=UTC0the output is unchanged.Test
find_ls_uses_local_timesets a file's mtime to an hour ago and checks the-lscolumn underTZ=UTC-5(fails on main).cargo test: all pass (test_find 86, 85 on main), clippy and fmt clean. Same column as GNU find 4.10.0 under TZ=Asia/Kolkata, UTC-5, UTC0 and America/New_York.#904 changes the same two lines (year for old files) and keeps UTC; whichever lands second needs a one-line rebase.