Final code will be
$w.onReady(function () {
automaticTime();
});
function automaticTime(){
const today = new Date();
const options = {
day: "numeric",
month: "short",
year: "numeric"
};
$w("#currentDate").text = today.toLocaleDateString("en-GB", options);
$w("#currentTime").text = today.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
setTimeout(automaticTime,1000);
}