const [date, setDate] = useState(new Date());
useEffect(() => {
 var timerID = setInterval( () => setDate(new Date()), 1000 );
 return function cleanup() {
  clearInterval(timerID);
 };
});
return (
 <div>
  <h4>Today</h4>
  <p><b>{date.toLocaleDateString()}</b></p>
   <h4>Time</h4>
   <p><b>{date.toLocaleTimeString()}</b></p>
 </div>
);