poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject cvs commit: jakarta-poi/src/java/org/apache/poi/hpsf Util.java
Date Thu, 13 Feb 2003 16:57:40 GMT
klute       2003/02/13 08:57:40

  Modified:    src/java/org/apache/poi/hpsf Util.java
  Log:
  Fixed a bug reading timestamps wrongly sometimes, placing the files'
  times in the Middle Ages. And no, neither Microsoft nor POI existed
  back then.
  
  Revision  Changes    Path
  1.7       +3 -3      jakarta-poi/src/java/org/apache/poi/hpsf/Util.java
  
  Index: Util.java
  ===================================================================
  RCS file: /home/cvs/jakarta-poi/src/java/org/apache/poi/hpsf/Util.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Util.java	1 Feb 2003 13:28:28 -0000	1.6
  +++ Util.java	13 Feb 2003 16:57:39 -0000	1.7
  @@ -176,7 +176,7 @@
        * 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.</p>
  +     * words stored in the structure.</p>
        *
        * @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 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);
  
  
  

Mime
View raw message