Skip to content

Commit 2201e96

Browse files
author
David Feshbach
committed
Fix month of modification date
tm_unz.tm_mon is the number of "months since January [0,11]" and must be adjusted before being used in NSDateComponents
1 parent 54cf13e commit 2201e96

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ZipArchive.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ -(BOOL) UnzipFileTo:(NSString*) path overWrite:(BOOL) overwrite
366366
components.minute = fileInfo.tmu_date.tm_min;
367367
components.hour = fileInfo.tmu_date.tm_hour;
368368
components.day = fileInfo.tmu_date.tm_mday;
369-
components.month = fileInfo.tmu_date.tm_mon;
369+
components.month = fileInfo.tmu_date.tm_mon + 1;
370370
components.year = fileInfo.tmu_date.tm_year;
371371

372372
NSCalendar *gregorianCalendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];

0 commit comments

Comments
 (0)