Skip to content

Conversation

@susnux
Copy link
Contributor

@susnux susnux commented Aug 13, 2025

Summary

ZIP does not use a proper timestamp but uses something called "DOS time".
This is a weird old format with some limitations like accuracy of only
2 seconds, but also no timezone information.
Also unlike UNIX time it is not relative to some specific point in time
with timezone information, but is always considered to be the local
time. Meaning we need to convert it first to the users local time.

Checklist

@susnux susnux added this to the Nextcloud 32 milestone Aug 13, 2025
@susnux susnux added bug 3. to review Waiting for reviews labels Aug 13, 2025
@joshtrichards joshtrichards added the hotspot: file time handling ctime, mtime, etc. handling during various operations label Aug 13, 2025
Base automatically changed from fix/streamer-directory-mtime to master August 13, 2025 15:58
@susnux susnux marked this pull request as ready for review August 13, 2025 16:07
@susnux susnux requested a review from a team as a code owner August 13, 2025 16:07
@susnux susnux requested review from come-nc, icewind1991 and sorbaugh and removed request for a team August 13, 2025 16:07
@susnux susnux force-pushed the fix/streamer-mtime-zip branch from 0b489d8 to 7428b5b Compare August 13, 2025 16:07
@susnux susnux requested a review from salmart-dev August 13, 2025 16:07
@susnux
Copy link
Contributor Author

susnux commented Aug 13, 2025

/backport to stable31

@susnux susnux force-pushed the fix/streamer-mtime-zip branch from 7428b5b to 6f0e0de Compare August 14, 2025 08:02
@susnux susnux requested a review from icewind1991 August 14, 2025 08:02
susnux added 2 commits August 14, 2025 17:19
ZIP does not use a proper timestamp but uses something called "DOS time".
This is a weird old format with some limitations like accuracy of only
2 seconds, but also no timezone information.
Also unline UNIX time it is not relative to some specific point in time
with timezone information, but is always considered to be the local
time. Meaning we need to convert it first to the users local time.

Signed-off-by: Ferdinand Thiessen <[email protected]>
@susnux susnux force-pushed the fix/streamer-mtime-zip branch from 6f0e0de to ba00416 Compare August 14, 2025 15:19
Copy link
Contributor

@come-nc come-nc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That means users A and B downloading the same zip content will get different time information in there? So if I download stuff and then send it to someone on another time zone times will look wrong on their computer?

@susnux
Copy link
Contributor Author

susnux commented Aug 14, 2025

That means users A and B downloading the same zip content will get different time information in there? So if I download stuff and then send it to someone on another time zone times will look wrong on their computer?

Yes and there is no fix - ZIP time is considered the local time of the user that created it.
You should rather use the TAR download ;)

@susnux susnux merged commit cd550d5 into master Aug 18, 2025
212 of 217 checks passed
@susnux susnux deleted the fix/streamer-mtime-zip branch August 18, 2025 12:39
@skjnldsv skjnldsv mentioned this pull request Aug 19, 2025
@skjnldsv skjnldsv modified the milestones: Nextcloud 32, Nextcloud 33 Sep 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews bug hotspot: file time handling ctime, mtime, etc. handling during various operations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Time get the wrong timezone when downloaded as zip

7 participants