Extract .7z archive keeping modified dates of extracted folders

7-zip7zacommand linezip

I have a .7z archive created with 7zip, and I can see the contents, including the folders with their modified dates intact.

When I extract the archive however, the newly extracted folders all have the created and modified dates set to the time and date they were extracted – i.e. the modified date that is visible in the archive is lost.

I've tried to extract via the 7-zip file manager has the same effect, and the command I'm using to extract the files is:

7za x -t7z SourceArchive.7z -oE:\TargetFolder 

this uses the x command (eXtract files with full paths) and uses the switches:

-t - Target Type, in this case 7z archive
-o - Output directory - here E:\TargetFolder

Any help appreciated

Best Answer

Extracted folders have the created/modified date set to the time/date of extraction

This is a known feature request (#1174), Status: open.

See also this 7-Zip discussion thread ZIP archive folder date preservation.


#1174 Preserve original file creating\edit dates when extracting

enter image description here

Now when files are extracted their creating date, edited date are set to current time despite in archive they could have their own dates, an option to preserve those would be very nice.

...

The hard part is already done. If you just right-click and under 7-zip, extract here/to, it should perform as expected.

After testing it appears that the above comment is incorrect and doesn't work.

Source #1174 Preserve original file creating\edit dates when extracting