[PR #40] [MERGED] Inconsistent time format #800

Closed
opened 2026-01-29 22:17:38 +00:00 by claunia · 0 comments
Owner

📋 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: masterHead: master


📝 Commits (1)

  • 62f198b All 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.

## 📋 Pull Request Information **Original PR:** https://github.com/adamhathcock/sharpcompress/pull/40 **Author:** [@Strachu](https://github.com/Strachu) **Created:** 1/14/2015 **Status:** ✅ Merged **Merged:** 1/14/2015 **Merged by:** [@adamhathcock](https://github.com/adamhathcock) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`62f198b`](https://github.com/adamhathcock/sharpcompress/commit/62f198b532dd6b2eda0d825cce16227a7acc826e) All archive types now consistently return times as local time. ### 📊 Changes **3 files changed** (+12 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `SharpCompress/Common/SevenZip/ArchiveReader.cs` (+1 -1) 📝 `SharpCompress/Common/Tar/Headers/TarHeader.cs` (+4 -4) 📝 `SharpCompress/Utility.cs` (+7 -4) </details> ### 📄 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 22:17:38 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#800