mini-software / MiniExcel

Fast, Low-Memory, Easy Excel .NET helper to import/export/template spreadsheet (support Linux, Mac)
https://www.nuget.org/packages/MiniExcel/
Apache License 2.0
2.81k stars 342 forks source link

C# 有现成的System.DateTime.FromOADate方法问什么不用,是有什么特殊处理吗? #592

Open shaofing opened 6 months ago

shaofing commented 6 months ago

https://github.com/mini-software/MiniExcel/blob/f6992131ec09207e186345b3bced7e48f8e98407/src/MiniExcel/Utils/DateTimeHelper.cs#L63

C# 有现成的System.DateTime.FromOADate方法问什么不用,自己实现的是有什么特殊处理吗?

shps951023 commented 6 months ago

@shaofing IsDateTimeFormat 还有 isDate1904 特别处理

shaofing commented 6 months ago

看了DateTimeHelper.FromOADate的实现与System.DateTime.FromOADate(.Net4.5反编译)的实现逻辑一模一样,好像没有处理isDate1904相关

shps951023 commented 5 months ago

@shaofing 👍我再确认下,假如没问题,预计下个版本移除 DateTimeHelper.FromOADate 或是能尝试PR? 这是你发现的 issue