const epochToDateHuman = ({epochTime=0})=>{
const valueConvert = 60000 // Base convert to Minutes to milliseconds
const milliseconds = 1000
const zone = (new Date().getTimezoneOffset() * -1 ) * valueConvert // Return subtract time zone
const newEpoch = epochTime * milliseconds // Convert new value in milliseconds
const dateConvert = new Date(newEpoch + zone) // New Date + Zone
return dateConvert}
const epoch = 1619456956
epochToDateHuman({epoch})
This arrow function epochToDateHuman, receives as parameters named epochTime that you want to convert to a zone date,
The const valueConvert is the basis for converting the zone obtained in minutes to Milliseconds, because Date (). getTimezoneOffset () returns your zone time difference in minutes and when we receive in epochTime we convert them to milliseconds multiplying by the constant milliseconds, like this we obtain newEpoch with a new value in milliseconds and zone in negative milliseconds that will be subtracted from newEpoch that passed to a new Date, we obtain the value for the zone of the date...
Happy hacking
Zellathor!