How do I programmatically check the date of a file in a Zip archive?

Someone asked on Stack Overflow:

Given that I have a zip file called archive.zip that contains a file called customerData, how can I programmatically check the date of the file inside archive.zip? I’m using the command-line Winzip utility wzunzip, but I wouldn’t object to possibly using something else.

I’m writing a .net application that will periodically read data from customerData. The file is very big and I want to abort the operation without extracting customerData if the date stamp has not been updated, indicating that there is new data to read.

I posted the following answer, which was chosen as the accepted answer and received 1 upvote:

Via http://dotnetzip.codeplex.com/. There is no native way (that I know) to do that.

Example Code:

ZipFile z = ZipFile.Read(@"C:\archive.zip");
foreach (ZipEntry zEntry in z)
{
    Console.WriteLine(zEntry.LastModified.ToString());
}

Originally posted on Stack Overflow — 1 upvotes (accepted answer). Licensed under CC BY-SA.

signed letter b

Dad. Geek. Gamer. Software developer. Cloud user. Old Car enthusiast.  Blogger.


Top Posts


profile for Nate on Stack Exchange, a network of free, community-driven Q&A sites
a proud member of the blue team of 512KB club
Thoughts, opinions, and ideas shared here are my own. © 2026 Nate Bross.