List of usage examples for org.apache.poi.ss.usermodel DateUtil setCalendar
public static void setCalendar(Calendar calendar, int wholeDays, int millisecondsInDay, boolean use1904windowing, boolean roundSeconds)
From source file:ec.util.spreadsheet.poi.FastPoiValueFactory.java
License:EUPL
/** * Same as {@link DateUtil#getJavaDate(double, boolean)} but with calendar * as first parameter to reduce memory usage. * * @param calendar/*from w w w . j ava 2 s . c o m*/ * @param date * @param use1904windowing * @return */ private static Date getJavaDate(Calendar calendar, double date, boolean use1904windowing) { int wholeDays = (int) Math.floor(date); int millisecondsInDay = (int) ((date - wholeDays) * DateUtil.DAY_MILLISECONDS + 0.5); DateUtil.setCalendar(calendar, wholeDays, millisecondsInDay, use1904windowing, false); return calendar.getTime(); }