Free Support Forum - aspose.com

M Date format formula value is not being picked correctly by Aspose.cells Java 7.3.1

A date value is formated with M option using office 2003, a reference file is attached with the defect. Please check row 42, column A. The formula shows proper date. but through aspose we are not able to get date format information.


thanks,

Khurram

Hi,

Thanks for your posting and using Aspose.Cells for Java.

Please download and try the latest version: Aspose.Cells for Java 7.4.1. It works fine.

I am able to get correct date value from cell A42. Below is a console output for your reference.

Output
Aspose.Cells.Cell [ A42; ValueType : IsDateTime; Value : N ]

Hi,


I think this might be a unique case, its not really a formula value here that we are talking about. in this case, the cell’s actual text shows N which is the first character of the month of that particular date value. but the actual date value is not retrieved. could there be a way to load date value in this case (the actual date which is formatted to show N instead of full date) if you can load the file in excel you shall see actual date being displayed in formula area and N is being shown in cell display text.

thanks,

Hi,

Thanks for your posting and using Aspose.Cells for Java.

Please use the following code to retrieve the actual date value.

Java


String filePath = “F:\Shak-Data-RW\Downloads\Test.xls”;


Workbook workbook = new Workbook(filePath);

Worksheet worksheet = workbook.getWorksheets().get(0);


Cell cell = worksheet.getCells().get(“A42”);


Object obj = cell.getValue();

String str = obj.toString();


System.out.println(str);

Output:
2010-11-12T00:00:00