read-excel-file
Version:
Read `.xlsx` files in a web browser or in Node.js
13 lines (12 loc) • 653 B
JavaScript
import parseExcelTimestamp from './parseExcelTimestamp.js';
// Parses an Excel Date (represented by a "serial" floating-point number)
// into a javascript `Date` in UTC+0 timezone (with time is set to 00:00).
//
// https://www.pcworld.com/article/3063622/software/mastering-excel-date-time-serial-numbers-networkdays-datevalue-and-more.html
// "If you need to calculate dates in your spreadsheets,
// Excel uses its own unique system, which it calls Serial Numbers".
//
export default function parseExcelDate(excelSerialDate, epoch1904) {
return new Date(parseExcelTimestamp(excelSerialDate, epoch1904));
}
//# sourceMappingURL=parseExcelDate.js.map