1// function to convert excel date to normal js date
2excelDateToJSDate(excelDate) {
3 var date = new Date(Math.round((excelDate - (25567 + 1)) * 86400 * 1000));
4 var converted_date = date.toISOString().split('T')[0];
5 return converted_date;
6}
1var record_date = Date.parse(item.record_date_string)
2var days = Math.round((record_date - new Date(1899, 11, 30)) / 8.64e7);
3item.record_date = parseInt((days).toFixed(10));
4
5return item;
1function ExcelDateToJSDate(serial) {
2 var utc_days = Math.floor(serial - 25569);
3 var utc_value = utc_days * 86400;
4 var date_info = new Date(utc_value * 1000);
5
6 var fractional_day = serial - Math.floor(serial) + 0.0000001;
7
8 var total_seconds = Math.floor(86400 * fractional_day);
9
10 var seconds = total_seconds % 60;
11
12 total_seconds -= seconds;
13
14 var hours = Math.floor(total_seconds / (60 * 60));
15 var minutes = Math.floor(total_seconds / 60) % 60;
16
17 return new Date(date_info.getFullYear(), date_info.getMonth(), date_info.getDate(), hours, minutes, seconds);
18}
19