switch in winzip -o what is it in 7zip

When using 7zip trying to keep the modified date on the  zipped file the same as the source file
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Joe Winograd, Fellow&MVEDeveloperCommented:
I've seen this feature requested before (in some cases, years ago), but as far as I know, it still has not been implemented. The latest thread I could find about it in the SourceForge discussions is this:

Note that Igor Pavlov himself (the author of 7-Zip) jumped into the thread, but was noticeably silent at the end of the thread when it turned to discussing the need for an option that would set the date of the archive to the most recent date of the file(s) that it contains.

My advice is to write a program/script to do this after you're done zipping it. You could even use the 7-Zip command line interface with the "l" (List) command to create a plain text file with the contents of the archive by redirecting the output to a file. For example:

7z l d:\path\archive.zip>d:\path\archivecontents.txt

That will create a text file with info like this:

   Date      Time    Attr         Size   Compressed  Name
------------------- ----- ------------ ------------  ------------------------
2012-01-12 08:35:54 ....A       108736        20767  scanner.bmp
2014-09-15 17:15:48 ....A      1232194      1199574  setup.exe
2013-12-06 10:29:22 ....A        11121         3337  setup.ini
2014-11-04 12:01:02 ....A          872          442  setup.txt
2014-04-16 09:56:36 ....A      1599272       750931  setupja.exe
2014-01-23 20:48:38 ....A       110592        56512  buttonapp\killkss.exe
2014-05-26 23:30:02 ....A    202077866    201328657  buttonapp\setup.exe
2014-12-15 12:31:44 D....            0            0  documentation\English
2014-07-01 08:25:26 ....A      1354031      1244189  documentation\English\User's Guide.pdf
2014-12-15 12:31:44 D....            0            0  documentation\French
2014-05-14 17:07:40 ....A       836290       764039  documentation\French\User's Guide.pdf
2014-12-15 12:31:46 D....            0            0  integrator\Kodak
2013-11-12 12:45:54 ....A        37488         6636  integrator\Kodak\debugging.htm
2013-11-12 12:45:40 ....A       264198        31554  integrator\Kodak\faq.htm
2013-11-12 12:45:26 ....A        51324         9127  integrator\Kodak\GettingStarted.htm

Open in new window

A program/script could easily sort by the Date/Time columns (which, btw, are the Modified time stamps — exactly what you want) and then set the date of the archive to the newest file. Regards, Joe

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Joe Winograd, Fellow&MVEDeveloperCommented:
The selected post explains exactly how to do it.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.