It's an "incompatible" change, presumably lots of existing scripts which may depend on the output format
of existing implementation, will be broken by this one.

Yes, the default timestamp in zip entry is dos datetime...Though the support for "more accurate" timestamp for zip file has been added (ZIS, ZOS and ZipFile), but due to its size increase of the resulting zip file, jar tool
does not use it, yet.

-Sherman

On 3/6/15 6:49 AM, Jacob Wisor wrote:
Hello there!

I have stumbled upon the jar tool always printing nominally the same date and time for a JarEntry, regardless of the timezone set. Confused by this, I dug into the code only to find out that the zip file format does neither store timezone information nor timestamps in UTC. This basically means that timestamps in jar/zip files are or can be assumed to always be in the local timezone, hence there is no conceivable fix for this problem, except for altering the zip file format specification. However, timestamps are printed in the en_US locale currently. This locale is /almost/ as arbitrary as every other. So, this patch makes the jar tool print timestamps in the default locale date and time format.

If anybody is bothered by this change they can still explicitly set the user.language property or the system's locale to en_US. If anybody /really/ wants to parse jar tool's timestamps output they should probably be relying on ISO formatted timestamps. I can add this functionality as a flag.

Anyways, please review this patch.

Regards,

Jacob

Reply via email to