public final class ExcelDateUtil extends Object
Date
or Calendar
.Modifier and Type | Method and Description |
---|---|
static Calendar |
getJavaCalendar(double excelDate,
boolean use1904windowing)
Given an Excel date with either 1900 or 1904 date windowing, converts it
to a java.util.Date.
|
static Date |
getJavaDate(double excelDate,
boolean use1904windowing)
Given an Excel date with either 1900 or 1904 date windowing, converts it
to a java.util.Date.
|
static Date |
getJavaDateOnly(double excelDate,
boolean use1904windowing)
Given an Excel date with either 1900 or 1904 date windowing, converts it
to a java.util.Date.
|
static boolean |
isValidExcelDate(double excelDate)
Given a double, checks if it is a valid Excel date.
|
public static Calendar getJavaCalendar(double excelDate, boolean use1904windowing)
excelDate
- The Excel date.use1904windowing
- true if date uses 1904 windowing, or false if using 1900 date
windowing.TimeZone
public static Date getJavaDateOnly(double excelDate, boolean use1904windowing)
excelDate
- The Excel date.use1904windowing
- true if date uses 1904 windowing, or false if using 1900 date
windowing.TimeZone
public static Date getJavaDate(double excelDate, boolean use1904windowing)
TimeZone
in Java uses Daylight Saving
Time then the conversion back to an Excel date may not give the same
value, that is the comparison excelDate ==
getExcelDate(getJavaDate(excelDate,false))
is not always true.
For example if default timezone is Europe/Copenhagen
, on
2004-03-28 the minute after 01:59 CET is 03:00 CEST, if the excel date
represents a time between 02:00 and 03:00 then it is converted to past
03:00 summer timeexcelDate
- The Excel date.use1904windowing
- true if date uses 1904 windowing, or false if using 1900 date
windowing.TimeZone
public static boolean isValidExcelDate(double excelDate)
excelDate
- the double valueCopyright © 2006–2022 Appendium - Portfolio Financing Platform. All rights reserved.