From 52bdd44cde593329bd9aa321652620bfe9ad2eda Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Fri, 12 Nov 2004 12:04:59 +0000 Subject: [PATCH] JDK 1.3- git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277027 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/zip/ZipOutputStream.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/org/apache/tools/zip/ZipOutputStream.java b/src/main/org/apache/tools/zip/ZipOutputStream.java index 3acc6c687..0d3c0ebdb 100644 --- a/src/main/org/apache/tools/zip/ZipOutputStream.java +++ b/src/main/org/apache/tools/zip/ZipOutputStream.java @@ -581,7 +581,7 @@ public class ZipOutputStream extends FilterOutputStream { written += 2; // last mod. time and date - writeOut(toDosTime(ze.getTime())); + writeOut(toDosTime(new Date(ze.getTime()))); written += 4; // CRC @@ -669,7 +669,7 @@ public class ZipOutputStream extends FilterOutputStream { written += 2; // last mod. time and date - writeOut(toDosTime(ze.getTime())); + writeOut(toDosTime(new Date(ze.getTime()))); written += 4; // CRC @@ -770,7 +770,7 @@ public class ZipOutputStream extends FilterOutputStream { * @since 1.1 */ protected static ZipLong toDosTime(Date time) { - return new ZipLong(toDosTime(time.getTime())); + return new ZipLong(toDosTime(time)); } /** @@ -780,9 +780,9 @@ public class ZipOutputStream extends FilterOutputStream { * * @since 1.26 */ - protected static byte[] toDosTime(long time) { + protected static byte[] toDosTime(Date time) { Calendar cal = Calendar.getInstance(); - cal.setTimeInMillis(time); + cal.setTime(time); int year = cal.get(Calendar.YEAR); if (year < 1980) { return DOS_TIME_MIN.getBytes();