I have looked up how to remove seconds from javascript time fetch. I have checked the worldclock API website. I am not familiar with JS, so I dont know the right question to input into search. Here is my code, I was hoping someone could point me in the right direction to remove seconds from the received output.
I want to go from HH:MM:SS to just HH:MM. I would appreciate any help. Thank you
window.onload = (ev => {
getTime().then();
});
let count = 0;
async function getTime(){
count+=1;
let data = await fetch('https://worldtimeapi.org/api/timezone/Etc/GMT+3');
let res = await data.json();
let result = res.datetime.toString();
let time = result.substring(11,19)
let digital_clock = document.getElementById('content')
digital_clock.innerHTML = time;
getTime().then();
console.log(count);