求答案
------解决方案--------------------
- Java code
double d1 = 41012.623599537; Calendar base = Calendar.getInstance(); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd "); SimpleDateFormat outFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); base.setTime(format.parse("1899-12-30 ")); base.add(Calendar.DATE, (int) d1); base.add(Calendar.MILLISECOND, (int) ((d1 % 1) * 24 * 60 * 60 * 1000)); System.out.println("Time=" + outFormat.format(base.getTime()));