Actualizar fecha y hora cada segundo angular

setInterval(() => {         
  //replaced function() by ()=>
  this.myDate = new Date();
  console.log(this.myDate); 
  // just testing if it is working
}, 1000);
Mysterious Mallard