The third version you used (shown blow) will never work - that is telling IO:Compress::Zip to use the values for the variables $atime, $mtime and $ctime in the extended timestamp field in the zip file. Those variable have no value, so that will screw up the extended timestamp in the zip file.

$ perl -M'IO::Compress::Zip qw(zip)' -e ' zip "abc" => "abc.zip", exT ime => [$atime, $mtime, $ctime] '

Perhaps you are running an ancient version of IO::Compress::Zip that predates the change where extended timestamp support was added. What version do you get when you run this?

$ perl -M'IO::Compress::Zip' -e 'print "$IO::Compress::Zip::VERSION\n" +' 2.061

Also, if you have zipinfo installed, that can tell if the zip archive contains the extended timestamp. In the output below the lines "file last modified on (UT extra field modtime)" show that this archive does have the more accurate timestamp.

$ perl -M'IO::Compress::Zip qw(zip)' -e ' zip "abc" => "abc.zip" $ zipinfo -v abc.zip Archive: abc.zip There is no zipfile comment. End-of-central-directory record: ------------------------------- Zip archive file size: 178 (00000000000000B2h) Actual end-cent-dir record offset: 156 (000000000000009Ch) Expected end-cent-dir record offset: 156 (000000000000009Ch) (based on the length of the central directory and its expected offse +t) This zipfile constitutes the sole disk of a single-part archive; its central directory contains 1 entry. The central directory is 73 (0000000000000049h) bytes long, and its (expected) offset in bytes from the beginning of the zipfile is 83 (0000000000000053h). Central directory entry #1: --------------------------- abc offset of local header from start of archive: 0 (0000000000000000h) +bytes file system or operating system of origin: Unix version of encoding software: 2.0 minimum file system compatibility required: MS-DOS, OS/2 or NT F +AT minimum software version required to extract: 2.0 compression method: deflated compression sub-type (deflation): normal file security status: not encrypted extended local header: yes file last modified on (DOS date/time): 2017 Jan 11 10:53:06 file last modified on (UT extra field modtime): 2017 Jan 11 10:53:07 + local file last modified on (UT extra field modtime): 2017 Jan 11 10:53:07 + UTC 32-bit CRC value (hex): 4788814e compressed size: 6 bytes uncompressed size: 4 bytes length of filename: 3 characters length of extra field: 24 bytes length of file comment: 0 characters disk number on which file begins: disk 1 apparent file type: text Unix file attributes (100644 octal): -rw-r--r-- MS-DOS file attributes (00 hex): none The central-directory extra field contains: - A subfield with ID 0x5455 (universal time) and 5 data bytes. The local extra field has UTC/GMT modification time. - A subfield with ID 0x7875 (Unix UID/GID (any size)) and 11 data by +tes: 01 04 5b 24 00 00 04 08 52 00 00. There is no file comment.

In reply to Re^7: Archive::Zip Modify Date Oddity by pmqs
in thread Archive::Zip Modify Date Oddity by lhchin

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.