Date doesn’t update the schedule?

Asked

Viewed 58 times

-1

I’m on a project at angle 7 that I need to present on the screen The time, I’ve used the Date'shortTime and it doesn’t update the schedule, any suggestions?

HTML

 <h3>{{ today | date:'shortTime' }}</h3>

JAVASCRIPT

 today: number = Date.now();
  • 2

    Today with type number???

  • 1

    Puts the complete component declaration.

  • thanks, but I already got !! I made a function that makes this I will post

  • myDateTimer() { Let d = new Date(); Let t = d.toLocaleTimeString(); Document.getElementById('clock'). innerHTML = t; }

1 answer

1

You can use a

today = new Date()

And format it on the front with the custom pipe

{{ today | date:"dd/MM/y - hh:mm:ss" }}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.