How to remove GMT from time in JS/HTML while using library

I’ve been searching for hours to how remove GMT from time on my website. I saw a lot of topics but couldn’t apply them in my code; I’m newbie in JS. I have the following code:

var timestamp = '<?=time();?>';

function updateTime() {
  $('#time').html(Date(timestamp));
  timestamp++;
}
$(function() {
  setInterval(updateTime, 1000);
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
TIME: <span id="time"></span> 

Which give me the following output:

TIME: Wed Oct 27 2021 00:26:01 GMT+0530 (US Standard Time)

But i Want only:

TIME: Wed Oct 27 2021 00:26:01

Answer

try this:

$(function() {
    setInterval(()=> {
        let d = new Date;
        $('#time').html(`${d.toDateString()} ${d.toLocaleTimeString()}`);
    }, 1000);
});