fs/operations: add support for unix and unixnano time formats #8726
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.
What is the purpose of this change?
First of all, thank you so much for this amazing project! 🙂 I found Rclone extremely useful and very well done.
In this very simple PR I'm adding support for two new time formats:
unix
andunixnano
. The reason behind this is that sometimes I use therclone lsf
command like this:to generate a sort of CSV-based "tree" of a directory (either local or remote) with file sizes and last modification times. But the output of such command is timezone-dependent (note the
+02:00
s). So, if I run the same command on one of my servers, which has a copy of the same folder but the system time zone set to UTC, I get this:So, even if the content of the directory is exactly the same, I'm unable to programmatically compare the two outputs, e.g. using the
diff
command.Since Unix timestamps are timezone-agnostic, with this PR I'm introducing the possibility to do this:
And:
I hope this is useful :) let me know what you think. Thanks in advance!
Was the change discussed in an issue or in the forum before?
I don't think so. I tried to search but couldn't find anything related :)
Checklist