Convert epoch string imported via Rest API to a YYYY-MM-DD date

Hello,

I have a hire_date field that is imported via API as an epoch string, e.g. 1675641600. How do I convert to a Date data type so I can use the Time dimension?

I figured it out, this worked for me.

var unixTimestamp = doc.hire_date;
if (unixTimestamp) {
return new Date(unixTimestamp * 1000);
}

2 Likes