question

BenjaminChew-3397 avatar image
0 Votes"
BenjaminChew-3397 asked TimonYang-MSFT commented

Epplus excelrange.text return wrong text for date and datetime

In my site user will upload an excel file with some data to be saved to the system. I am using EPPlus for extracting data from excel file. I am encountering an issue for date and datetime data. Eg: if user enter 30/03/2021 in the excel file, the code will only read that particular cell text as 30. How do i fix this?

dotnet-csharp
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@BenjaminChew-3397
Could you please show your code with this problem?
I used this code for testing, but there is no problem.

             ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
    
             using (var pck = new ExcelPackage(new System.IO.FileInfo(@"C:\...\1.xlsx")))
             {
                 var ws = pck.Workbook.Worksheets[0];
    
                 var test1 = ws.Cells["A1"].Value;
           
                 Console.WriteLine(test1);
             }

123877-1.png


0 Votes 0 ·
1.png (7.9 KiB)

@BenjaminChew-3397
I have not heard from you for a couple of days. Please let me know if there is anything that I can help here

0 Votes 0 ·

0 Answers