Excel date convertion in JavaScript gives one day less

52 views Asked by At

I was trying convert the excel date "47308" to date object in javascript using the below method

function getExcelDateAsDate(excelDate, format){
    var unixTimestamp = (excelDate-25569)*86400000 ;
    return new Date(unixTimestamp);
}

however,I am getting the value as "Sun Jul 08 2029 20:00:00 GMT-0400 (Eastern Daylight Time)" in javscript instead of "Mon Jul 09 2029".

Any idea why am I getting 1 day less in javascript.

0

There are 0 answers