-
-
Notifications
You must be signed in to change notification settings - Fork 896
Update s3fs.go #2086
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Update s3fs.go #2086
Conversation
Convert S3 UTC Time to Local Signed-off-by: fdefilippo <[email protected]>
|
Thanks for this PR. I assume it’s related to file listings returned by the Could you clarify the reasoning and use cases for these proposed changes? The code might need some improvements, but we can tackle those later if the change is accepted. |
I have verified that file modification times are correctly displayed using the following clients, in addition to the SFTP CLI: FileZilla In all tests, the returned time zone is consistent and correct after applying the patch.
Rationale and Use Cases (Reasoning Behind Proposed Changes) The primary motivation for this change lies in the non-standardized and often inconsistent handling of file timestamps when using Object Storage (S3) endpoints, such as MinIO or AWS S3. The Core Problem S3 providers (including MinIO and AWS, which were tested) return file modification timestamps (last modified time) exclusively in the UTC (Coordinated Universal Time) format. Use Case and Proposed Solution End-users, however, require that these timestamps be displayed in the server's or client's Localtime for critical operational reasons: Operational Consistency: Most tools for backup, synchronization, and general file management rely on the system's local time zone for accurate comparisons. Usability: Displaying a file's timestamp in UTC within a local operating environment creates confusion and leads to interpretation errors regarding the exact time a file was uploaded or modified. The patch implements the necessary logic to convert the UTC timestamp to the local time zone of the SFTPGo server before transmitting it to the SFTP client, ensuring consistency and improved usability for all clients accessing S3 storage backends. |
|
first the object storage (minio): the Last-Modified showing GMT (https://github.com/minio/object-browser/issues/2462) whitout patch: with patch, sftp client: winscp (and filezilla) with or without applied localtimestamp:
|
|
try |
yes but not ls -la without filename: |
|
Yes, because sftp cli uses file attributes in the latter case and ls formatting in the first case. It is the client that should convert timestamp in local time, the file attributes are epoch timestamps. FileZilla and WinSCP always convert in local time, this is consistent and does not assume that client and server are in the same timezone |




Convert S3 UTC Time to Local
Checklist for Pull Requests