jet.report.xls
Class DateUtil

java.lang.Object
  extended by jet.report.xls.DateUtil

public class DateUtil
extends java.lang.Object

Contains methods for dealing with Excel dates. It is a tool by which converting the Date to Excel file needs to convert to double values.


Method Summary
static double getExcelDate(java.util.Date date)
          Converts the given date into a double value of its internal Excel representation, which is the number of days since 1/1/1900.
static java.util.Date getJavaDate(double date)
          Converts the given Excel date into the Java representation of a date.
static boolean isValidExcelDate(double value)
          Checks if the given double value is a valid Excel date.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getExcelDate

public static double getExcelDate(java.util.Date date)
Converts the given date into a double value of its internal Excel representation, which is the number of days since 1/1/1900. Fractional days represent hours, minutes, and seconds.

Parameters:
date - the Date
Returns:
Excel representation of Date (-1 if error - test for error by checking for less than 0)

getJavaDate

public static java.util.Date getJavaDate(double date)
Converts the given Excel date into the Java representation of a date.

Parameters:
date - the Excel Date
Returns:
Java representation of a date (null if error)

isValidExcelDate

public static boolean isValidExcelDate(double value)
Checks if the given double value is a valid Excel date.

Parameters:
value - the double value
Returns:
true if valid