static Date toDate ( double d ) { GregorianCalendar ret = new GregorianCalendar ( 1899 , 11 , 30 ) ; int days = ( int ) d ; d -= days ; ret . add ( Calendar . DATE , days ) ; d *= 24 ; int hours = ( int ) d ; ret . add ( Calendar . HOUR , hours ) ; d -= hours ; d *= 60 ; // d += 0.5; // round int min = ( int ) d ; ret . add ( Calendar . MINUTE , min ) ; d -= min ; d *= 60 ; int secs = ( int ) d ; ret . add ( Calendar . SECOND , secs ) ; return ret . getTime ( ) ; }
Called from the native code to assist VT_DATE - > Date conversion .