alarm js pergi ke url

function goUrlAlarm(time = '01:02:03', url) {
  const today = new Date();
  const month = today.getUTCMonth();
  const day = today.getUTCDate();
  const year = today.getUTCFullYear();
  const x = new Date(`${year}-${month}-${day}T${time}`);
  const t = new Date(x) - new Date();
  setTimeout(function () {
    location.href = url;
  }, t);
}

goUrlAlarm('12:00:00', 'http://google.com');
Enthusiastic Eagle