Excel Date field value differs from c# dateTime by 1 day while reading excel file with EEPlus

一曲冷凌霜 提交于 2019-12-11 03:43:21

问题


I have a problem with getting correct date field value from excel (.xlsx) file with EEPlus library.

The particular problem is that in excel i have e.g. 1900.01.04, but in C# I get 1900.01.03.

I had an idea, that when I read date value from excel it (EEPlus) converts it to utc and I should convert it to local time zone, but as time values of date object are nil it's probably not the case.

var date = (DateTime) Worksheet.Cells[row, column].Value;

Thanks!


回答1:


If the EEPlus date differs from the Excel date then it is probably a bug in EEPlus.

It is likely that it is accounting for the infamous Excel 1900 leap year bug but only for dates after February 29(!!) 1900.



来源:https://stackoverflow.com/questions/19915228/excel-date-field-value-differs-from-c-sharp-datetime-by-1-day-while-reading-exce

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!