Class HSSFDateUtil


  • public class HSSFDateUtil
    extends java.lang.Object
    Contains methods for dealing with Excel dates.
    Modified by Cedric Pronzato
    Author:
    Michael Harhen, Glen Stampoultzis (glens at apache.org), Dan Sherman (dsherman at isisph.com), Hack Kampbjorn (hak at 2mba.dk)
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int computeZeroDate​(java.lang.String config, boolean excelBugCompatible)  
      static java.math.BigDecimal getExcelDate​(java.util.Date date)  
      static java.math.BigDecimal getExcelDate​(java.util.Date date, boolean excelBugCompatible, int zeroDate)  
      static java.util.Date getJavaDate​(java.math.BigDecimal date)
      Given a excel date, converts it into a Date.
      static java.util.Date getJavaDate​(java.math.BigDecimal date, boolean excelBugCompatible, int zeroDate)  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • computeZeroDate

        public static int computeZeroDate​(java.lang.String config,
                                          boolean excelBugCompatible)
      • getExcelDate

        public static java.math.BigDecimal getExcelDate​(java.util.Date date)
      • getExcelDate

        public static java.math.BigDecimal getExcelDate​(java.util.Date date,
                                                        boolean excelBugCompatible,
                                                        int zeroDate)
      • getJavaDate

        public static java.util.Date getJavaDate​(java.math.BigDecimal date)
        Given a excel date, converts it into a Date. Assumes 1900 date windowing.
        Parameters:
        date - the Excel Date
        Returns:
        Java representation of a date (null if error)
      • getJavaDate

        public static java.util.Date getJavaDate​(java.math.BigDecimal date,
                                                 boolean excelBugCompatible,
                                                 int zeroDate)