const timestamp = 1666632563000;

const date = new Date(timestamp);


const formattedDate = date.toLocaleDateString('en-US', {
    year: 'numeric',
    month: 'long',
    day: 'numeric'
});

console.log(formattedDate); // Output: October 24, 2022
const formattedDate = date.toLocaleDateString('en-US', {
    weekday: 'long',
    year: 'numeric',
    month: 'short',
    day: 'numeric'
});

console.log(formattedDate); // Output: Monday, Oct 24, 2022

with Moment.js

const moment = require('moment');

const formattedDate = moment(timestamp).format('MMMM Do YYYY, h:mm:ss a'); 
console.log(formattedDate); // Output: October 24th 2022, 10:42:43 am

Convert a timestamp to a human-readable date

new Date(1730088121*1000);

Convert a date to a timestamp

Math.floor(new Date().getTime()/1000.0);

References:

  • https://www.epochconverter.com/