Date import coming in odd

I have a csv that I’m importing the date 11/17/22 11:27, but when I download the spreadsheet in my flow and use the spreadsheet node the date changes to 44882.47708333333. I’m not even sure what format that is and need to convert to. I’ve tried reformating with moment, but I’m either doing it wrong or something is messing up on the download.

Im then trying to convert that back to something readable doing the following and my Console out is giving me a date of 1970-00-01

let ibexlastContact = $input.item.json.lastContact;
const now = new Date();
if(ibexlastContact != 'undefined' || ibexlastContact != null){
  console.log('here')
  let a = moment(ibexlastContact).format('YYYY-mm-DD'); 
  
  console.log(a);

Hi there,

These are serial date time stamps used in Excel for example. There are a few options to convert them I got from google.

new Date(Math.round((date - 25569)*86400*1000));
new Date(Date.UTC(0, 0, excelSerialDate - 1));

The -1 in the last one is the offset for UTC.
more info:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.