function DateTimeoffsetToString(unix) { var dateObj = new Date(unix);
var year = dateObj.getFullYear();
var month = ("0" + (dateObj.getMonth() + 1)).slice(-2);
var day = ("0" + dateObj.getDate()).slice(-2);
var hours = ("0" + dateObj.getHours()).slice(-2);
var minutes = ("0" + dateObj.getMinutes()).slice(-2);
var seconds = ("0" + dateObj.getSeconds()).slice(-2);
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
}
console.log(DateTimeoffsetToString(1609459200000));