From 90e630a955651c2c474ff81e84ddd6a926612b03 Mon Sep 17 00:00:00 2001 From: Rainer Klute Date: Thu, 13 Feb 2003 16:57:39 +0000 Subject: [PATCH] Fixed a bug reading timestamps wrongly sometimes, placing the files' times in the Middle Ages. And no, neither Microsoft nor POI existed back then. git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353006 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/poi/hpsf/Util.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/java/org/apache/poi/hpsf/Util.java b/src/java/org/apache/poi/hpsf/Util.java index 1ff9b5a52..9d138114d 100644 --- a/src/java/org/apache/poi/hpsf/Util.java +++ b/src/java/org/apache/poi/hpsf/Util.java @@ -176,7 +176,7 @@ public class Util * file. The structure identifies a 64-bit integer specifying the * number of 100-nanosecond intervals which have passed since * January 1, 1601. This 64-bit value is split into the two double - * word stored in the structure.

+ * words stored in the structure.

* * @param high The higher double word of the FILETIME structure. * @param low The lower double word of the FILETIME structure. @@ -184,7 +184,7 @@ public class Util */ public static Date filetimeToDate(final int high, final int low) { - final long filetime = ((long) high) << 32 | ((long) low); + final long filetime = ((long) high) << 32 | (low & 0xffffffffL); final long ms_since_16010101 = filetime / (1000 * 10); final long ms_since_19700101 = ms_since_16010101 - EPOCH_DIFF; return new Date(ms_since_19700101);