Date Modified in zip file

Nov 5, 2008 at 1:42 PM
Is it possible to keep a file's "date modified" property (and perhaps others properties) when adding it to a zip file?
Nov 5, 2008 at 2:08 PM
Edited Nov 5, 2008 at 2:20 PM
You know, I have to admit I am having trouble with the Date Modified thing.
You would think it would be really easy, wouldn't  you?  Well it hasn't been, not for me anyway.

It has to do with the way .NET handles dates and times, which is different than the way the Windows filesystem handles dates and times. I am frustrated that I haven't got this resolved yet. The behavior has changed since the recent daylight-saving-time shift last weekend.
I will have another look at it.

Aside from the last-modified time, what other properties do you want to have preserved? Can you be specific?
Nov 7, 2008 at 7:13 AM
Noting in particular - I was just thinking that there might be other file properties that might get changed.
It don't really need the modified date to be preserved- I just thought it would be nice
Jan 4, 2011 at 9:35 PM
Edited Jan 5, 2011 at 1:39 PM

I have the following when creating and merging zip files

What the problem is : Don;t know how to preserve the orginal created, modified and accessed time.

Please advise.




ZipFile zipnew = ZipFile.Read(strPath);

ZipFile zipold = new ZipFile(path);

{using (System.IO.MemoryStream mem = new System.IO.MemoryStream(Convert.ToInt32(zenew.UncompressedSize)))


stringfn = zenew.FileName.ToString();

zipold.UpdateEntry(fn, mem.ToArray());