Excel Date to C# date,来自这里的
public static DateTime ConvertToDateTime(double excelDate) { if (excelDate < 1) { throw new ArgumentException("Excel dates cannot be smaller than 0."); } DateTime dateOfReference = new DateTime(1900, 1, 1); if (excelDate > 60d) { excelDate = excelDate - 2; } else { excelDate = excelDate - 1; } return dateOfReference.AddDays(excelDate); }