Angular 2 show current formatted date

前端 未结 3 734

I have the following code to show the current date:

this.whatTime = Observable.interval(1000).map(x => new Date()).share();

And in my te

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-19 17:46

    Use Angular2 built in Date Pipe

    {{whatTime | async | date:'yMdjm'}}
    

提交回复
热议问题