I want to show current active time in angular 11.
I did like this
setInterval(() => {
this.UKTime = formatDate(
Date.now(),
"dd-MM-yy hh:mm a",
"en-US",
"+0100"
);
this.SLTime = formatDate(
Date.now(),
"dd-MM-yy hh:mm a",
"en-US",
"+0530"
);
}, 1000);
But I do not need timer.
Is there any other way to show current time?