Wrong date value formatting / Getting exact date value

Hello,

I have two questions about date values. In the following examples all values are on the German culture.

First of all, please take a look at my file (Date.zip (6.2 KB)). Cell A1 shows “20. Mai” and the cell value is “20.05.2018”. Cells reads the value as “20.Mai”. I actually expect the value to be read as formatted in Excel: “User defined: TT. MMM” with an whitespace between the dot and Mai (May). Seems to be an error from Cells.

Next question is: How do I get the values that are in the Excel edit bar? The only possibility I see is that I am working with DateTimeValue. The problem is, you get the time value (20.05.2018 00:00:00) without actually specifying it.
DateValues.png (6.2 KB)

@mservdev,
We were able to observe the issue where “20.Mai” is extracted instead of “20. Mai” but we need to look into it more. We have logged the issue in our database for investigation and for a fix. Once, we will have some news for you, we will update you in this topic.

This issue has been logged as

CELLSNET-46769 - Cell value extracted different than Excel in German culture

Regarding your second question, I could not find and property which directly corresponds to formula bar in Excel, however you may try following sample code to extract the required value in specified format.

Workbook wb = new Workbook(path + "Date.xlsx");
Cell cell = wb.Worksheets[0].Cells["A1"];
Aspose.Cells.Style st = cell.GetStyle();
st.Custom = "dd.MM.yyyy";
cell.SetStyle(st);
Console.WriteLine(cell.StringValue);
//OR
Console.WriteLine(cell.DisplayStringValue);

@mservdev,

This is to inform you that we have fixed your issue “CELLSNET-46769”. We will soon provide you the fixed version after performing QA and incorporating other enhancements and fixes.

Great and thanks for the sample, it solved my problem!

@mservdev,
Good to know that your issue is resolved by using the suggested sample code. We will let you know once the fix is ready to share for space issue.

@mservdev,

Please try our latest version/fix: Aspose.Cells for .NET v19.5.5 (attached)

Your issue “CELLSNET-46769” should be fixed in it.

Let us know your feedback.
Aspose.Cells19.5.5 For .Net2_AuthenticodeSigned.Zip (4.9 MB)
Aspose.Cells19.5.5 For .Net4.0.Zip (4.9 MB)

I confirm it works as expected, thank you!

@mservdev,

Good to know that your issue is sorted out by the new fix/version. Feel free to contact us any if you need further help or have some other issue or queries, we will be happy to assist you soon.

The issues you have found earlier (filed as CELLSNET-46769) have been fixed in Aspose.Cells for .NET v19.6. This message was posted using BugNotificationTool from Downloads module by Amjad_Sahi