[PR #877] Fixed bug in zip time header flags #1303

Open
opened 2026-01-29 22:19:52 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/adamhathcock/sharpcompress/pull/877

State: closed
Merged: Yes


Parsing the times in the zip headers worked, but the flag check was wrong, so only modified time was ever parsed. Corrected this in a more readable way.

Also stopped exceptions being thrown if there was an issue during this header parsing, returning null values instead.

Remarks have been added to highlight that they return UTC DateTime's, rather than LastModifiedTime which returns a local DateTime.

**Original Pull Request:** https://github.com/adamhathcock/sharpcompress/pull/877 **State:** closed **Merged:** Yes --- Parsing the times in the zip headers worked, but the flag check was wrong, so only modified time was ever parsed. Corrected this in a more readable way. Also stopped exceptions being thrown if there was an issue during this header parsing, returning null values instead. Remarks have been added to highlight that they return UTC `DateTime`'s, rather than `LastModifiedTime` which returns a local `DateTime`.
claunia added the pull-request label 2026-01-29 22:19:52 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#1303