I am working on importing data in an Excel file and it has date column.
In my app, that date column value comes as a serial number like 43101.622083333335
which stands for 01/01/2018
.
When converting this serial number from Excel back to the normal date it stands for, it gives wrong year.
For example, it gives 01-Jan-1970
instead of 01-Jan-2018
``
var moment = require('moment');
var excelDate = 43101.622083333335;
var date = moment(new Date(excelDate));
var dateWithNewFormat = date.format('DD-MMM-YYYY');
console.log(dateWithNewFormat);
``
Output: 01-Jan-1970
instead of 01-Jan-2018
Any help ? Thanks in advance.