mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-07 21:22:04 +00:00
[PR #40] [MERGED] Inconsistent time format #800
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/adamhathcock/sharpcompress/pull/40
Author: @Strachu
Created: 1/14/2015
Status: ✅ Merged
Merged: 1/14/2015
Merged by: @adamhathcock
Base:
master← Head:master📝 Commits (1)
62f198bAll archive types now consistently return times as local time.📊 Changes
3 files changed (+12 additions, -9 deletions)
View changed files
📝
SharpCompress/Common/SevenZip/ArchiveReader.cs(+1 -1)📝
SharpCompress/Common/Tar/Headers/TarHeader.cs(+4 -4)📝
SharpCompress/Utility.cs(+7 -4)📄 Description
Currently, not all archive types return the modification time of entry in the same format. ZIP returns the time in local time, while TAR and 7Z returns UTC time.
This has caused that in my timezone the modification time for .zip entries were correct, while the ones for .tar and .7z entries were 1 hour off.
I have fixed it, so that now every archive returns time as local time.
I was not sure whether it's better to always return local or UTC time, but I have decided to return local time as it is a bit more intuitive for a user. In the long term, it does not matter, as there is conversion available between them with the usage of .ToLocalTime() and ToUniversalTime() .methods, what matters is that returned times have to be consistent for all supported formats.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.