I'm a newbie in Javascript, i have a problem when convert UNIX time to other GMT time. My code below :
This function to get Unix time from server
fetch(url)
.then(
function (response) {
if (response.status !== 200) {
console.log('Looks like there was a problem. Status Code: ' +
response.status);
return;
}
response.json().then(function (data)
{
//data is Unixtime , data=1596514540815
//I want convert it to other GMT date time, example GMT+2, GMT+3...
});
}
)
.catch(function (err) {
console.log('Fetch Error :-S', err);
});
I want convert it (data) to other GMT date time,example GMT+1,GMT+2 ... How can i do it ?