excelSerialToDate function

DateTime excelSerialToDate(
  1. double serial
)

Excel 1900-date-system serial → UTC date (leap-year bug included).

Implementation

DateTime excelSerialToDate(double serial) {
  final int days = serial.floor();
  final int ms = ((serial - days) * 86400000).round();
  return DateTime.utc(1899, 12, 30).add(Duration(days: days, milliseconds: ms));
}