Code example for GregorianCalendar

Methods: getTimeset

    final BigDecimal fractionNum = date.subtract(wholeDays);
    final BigDecimal fraction = fractionNum.multiply(DAY_MILLISECONDS);
    // the use of the calendar could be probably removed, as there is no magic in converting 
    // a running number into a date. 
    final GregorianCalendar calendar = new GregorianCalendar(1900, 0, wholeDaysInt + correction);
    calendar.set(Calendar.MILLISECOND, fraction.setScale(0, BigDecimal.ROUND_HALF_UP).intValue());
    return calendar.getTime();
Stop searching for code, let great code find you!  Add Codota to your java IDE