jszip icon indicating copy to clipboard operation
jszip copied to clipboard

The date in the exported file is incorrect

Open p76 opened this issue 1 year ago • 3 comments

The timestamp of the downloaded zip file does not match the file time, and the file time is incorrect image

p76 avatar Nov 13 '24 07:11 p76

This needs a little more information to be resolved, can you provide a reproducible scenario?

jonkoops avatar Mar 26 '25 17:03 jonkoops

I faced this issue today. In the browser (Firefox), I create a zip:

const zip = new JSZip();
const fileContent = await download(fileStatus.fileId); // Uint8Array
zip.file(filename, fileContent);
const buffer = await zip.generateAsync({
  compression: "DEFLATE",
  compressionOptions: {level: 9},
  type: "uint8array",
});

If I save the zip from buffer on my system and then extract it immediately, I get this:

-rw-rw-r-- 1 cleyfaye cleyfaye  40827 May 21 08:26 'content.pdf'
-rw-rw-r-- 1 cleyfaye cleyfaye 607523 May 21 10:26 'generated.zip'

As expected, the zip creation time is correct (it shows 10:26 here); but the extracted file have 08:26. It feels like it's a timezone issue (I'm currently in a UTC+2 timezone). This behavior happens across multiple systems: using unzip on a debian system or whatever default zip tools exists on OSX.

CleyFaye avatar May 21 '25 08:05 CleyFaye

https://github.com/Stuk/jszip/issues/369

VXleaf avatar Jun 05 '25 01:06 VXleaf