convert excel date to javascript date

Solutions on MaxInterview for convert excel date to javascript date by the best coders in the world

showing results for - "convert excel date to javascript date"
Giulio
24 Sep 2019
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}
Matilda
04 Jan 2020
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;
Donovan
03 Jul 2016
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
queries leading to this page
convert javascript date to excel dateconvert excel data to jsexcel date format to js dateget date from excel document with jsjavascript date into excel formathow to convert date number from excel to js datejs to excel dateconvert excel date values to date format in javascriptjavascript convert numbers excel to dateconvert excel date number to date jsconvert date serial number to date in javascriptexcel time to javascriptconvert javascript date into excel dateexcel date to javascript datehow to read date from excel in javascriptimport date from excel to javascriptjavascript reading date from excelconvert excel date to js datejs convert excel date to normal datemoment excel date convertexcel date to js dateconvert excel time to javascript timedayjs convert date formatjavascript to date excelhow to get the year from a date excel javascriptexcel date to js in angulardate and time to show in excell from node jswhen saving dattime to excel convert to number node jsnode js datatime excelexcel date format to js formatexcel import data to date javascriptconvert number excel to date jsjs excel date number to datejavascript excel date to datesave string date time in excel as numbers using node jsjavascript convert date excelconvert java datatime to excel datetime node jsdatetime format js excelconvert js date to excel dateconvert excel date to javascript datehow to convert excel date number to date jsjavascript how to convert date from excelconvert javascript datetime to excel datetimeconvert nuber excel to date jsjavascript convert excel date date formatexcel date format to js date javascriptconvert excel date to javascript date