Index: src/OFZooArchiveEntry.h ================================================================== --- src/OFZooArchiveEntry.h +++ src/OFZooArchiveEntry.h @@ -40,11 +40,11 @@ unsigned long long _uncompressedSize, _compressedSize; bool _deleted; OFString *_Nullable _fileComment; OFString *_fileName, *_Nullable _directoryName; OFNumber *_Nullable _POSIXPermissions; - uint8_t _timeZone; + int8_t _timeZone; OF_RESERVE_IVARS(OFZooArchiveEntry, 4) } /** * @brief The compression method of the entry. @@ -59,9 +59,15 @@ /** * @brief Whether the file was deleted. */ @property (readonly, nonatomic, getter=isDeleted) bool deleted; +/** + * @brief The time zone in which the file was stored, as an offset in hours + * from UTC (as a float). + */ +@property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFNumber *timeZone; + - (instancetype)init OF_UNAVAILABLE; @end OF_ASSUME_NONNULL_END Index: src/OFZooArchiveEntry.m ================================================================== --- src/OFZooArchiveEntry.m +++ src/OFZooArchiveEntry.m @@ -213,10 +213,18 @@ objc_autoreleasePoolPop(pool); return [date autorelease]; } + +- (OFNumber *)timeZone +{ + if (_timeZone == 0x7F) + return nil; + + return [OFNumber numberWithFloat: (float)_timeZone / 4]; +} - (OFString *)description { void *pool = objc_autoreleasePoolPush(); OFString *ret = [OFString stringWithFormat: Index: utils/ofarc/ZooArchive.m ================================================================== --- utils/ofarc/ZooArchive.m +++ utils/ofarc/ZooArchive.m @@ -177,10 +177,32 @@ [OFStdOut writeString: @"\t"]; [OFStdOut writeLine: OF_LOCALIZED( @"list_modification_date", @"Modification date: %[date]", @"date", modificationDate)]; + + if (entry.timeZone != nil) { + float timeZone = entry.timeZone.floatValue; + int hours = (int)timeZone; + unsigned char minutes = (timeZone - hours) * 60; + OFString *timeZoneString; + + if (hours > 0) + timeZoneString = [OFString + stringWithFormat: @"UTC+%02d:%02u", + hours, minutes]; + else + timeZoneString = [OFString + stringWithFormat: @"UTC-%02d:%02u", + -hours, minutes]; + + [OFStdOut writeString: @"\t"]; + [OFStdOut writeLine: OF_LOCALIZED( + @"list_timezone", + @"Time zone: %[timezone]", + @"timezone", timeZoneString)]; + } if (entry.POSIXPermissions != nil) { OFString *permissionsString = [OFString stringWithFormat: @"%llo", entry.POSIXPermissions Index: utils/ofarc/localization/de.json ================================================================== --- utils/ofarc/localization/de.json +++ utils/ofarc/localization/de.json @@ -126,10 +126,11 @@ list_version_made_by: "Erstellt mit Version: %[version]", list_min_version_needed: "Mindestens benötigte Version: %[version]", list_general_purpose_bit_flag: "General Purpose Bit Flag: %[gpbf]", list_extra_field: "Extra-Feld: %[extra]", list_comment: "Kommentar: %[comment]", + list_timezone: "Zeitzone: %[timezone]", list_deleted: [ "Gelöscht: ", [ {"deleted == 0": "Nein"}, {"": "Ja"}