JSFiddle - React, Tailwind, and code Playground

JavaScript

function printDate() {
  var date = new Date();
  
  console.log(date);
}

// setInterval로 1초마다 함수를 실행
setInterval(printDate, 1000);