I have evaluated your issue a bit and observed the issue. Could you also provide the following details, so we could evaluate your issue properly and may log a ticket into our database for investigation and resolution:
1) What is the valid Date/Time it should print when converting the value to DateTime?
2) What is your regional/ locale settings set on your system?
Thanks for providing us further details, template file and updated code segment.
After an initial test, I observed the issue as you mentioned by using your sample code with your template file. I found that DateTime.toDate() gives wrong value. I also found that the issue does not occur if the DateTime year is 2016 but it does not give correct DateTime value for the year 1900.
e.g Sample code:
…
Workbook wb = new Workbook(“C:/time.xlsx”); DateTime value = (DateTime) wb.getWorksheets().get(0).getCells().get(“A2”).getValue(); System.out.println(value); System.out.println(value.toDate()); System.out.println("----"); value = (DateTime) wb.getWorksheets().get(0).getCells().get(“A3”).getValue(); System.out.println(value); System.out.println(value.toDate());
I have logged a ticket with an id “CELLSJAVA-41742” for your issue. We will look into it soon.
Once we have any update on it, we will let you know here.
The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan