How to get Current Date time

前端 未结 5 726
日久生厌
日久生厌 2021-01-11 13:06

How can I get current date and time in angularjs

I have tried the following:

{{Date.Now}}

But it d

5条回答
  •  萌比男神i
    2021-01-11 13:25

    In your controller

    scope.v.Dt = Date.now();
    

    The DOM syntax is

    {{v.Dt | date:'medium'}}
    

    For an example -

    Output - Oct 28, 2010 8:40:23 PM

提交回复
热议问题