I'm using an API in javascript that retrieves several information of stocks such as open, high, low and closing prices as well as date. However,this date is in epoch format (date: 1627047000, for example). How could I format this in this code so that I could have something like DD/MM/YYYY?
const yahooStockAPI = require('yahoo-stock-api');
async function main() {
const startDate = new Date('07/01/2021');
const endDate = new Date('07/25/2021');
console.log(await yahooStockAPI.getHistoricalPrices(startDate, endDate, 'AMZN', '1d'));
}
main();
Thank you in advance!