Convert Timestamp To Date Using Angular 2 Pipes
Answer :
As mentioned by @Perry you will need to provide the date in milliseconds. From the Angular 2 reference for date we have:
expression is a date object or a number (milliseconds since UTC epoch)
or an ISO string
So it can be simply be:
{{load.loadDate * 1000 | date}}
I used:
<div>{{score.timestamp | date:'dd/MM/yyyy'}}</div>
More info in https://angular.io/api/common/DatePipe
Comments
Post a Comment