On 2013-01-11, Stefan Bodewig wrote:

> On 2013-01-10, Julius Davies wrote:

>> This is one my unit tests that I recently added that's failing.

> They fail on my machine as well (GMT+1 right now) and create times one
> hour different from vmgump which runs in GMT.

> The times that are different from the expected times are the times taken
> directly from ZipEntry and not those taken from the extra field.

At least for my machine I've fixed the tests.

I think you have created the archive using InfoZIP's zip.  zip writes
(and expects) the time stored in ZIP LFHs (and CDs) to be in GMT while
java.util.zip.ZipEntry expects them to be in local time.

Your local YEAR-01-01-00:00 was translated into (YEAR-1)-12-31-16:00
when you created the archive and java.util.zip takes this as local time.
Think I have this the right way around, but I'm starting to confuse
myself here :-)

Tests pass on my machine now by first adding my local GMT offset and
then adding eight hours.  I haven't tested it for any other time zone
but am confident it will work for vmgump as well (since the GMT offset
is 0 there).  In particular I didn't try a system where DST is active on
new years day - the test likely needs to take this into account as well.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to