Yaroslav  Osetrov Yaroslav Osetrov - 2 months ago 11
AngularJS Question

AngularJS. Convert tag value (Unix time to human-readable time)

I am getting data from a database and displaying it:

<li ng-repeat="item in items>

is a Unix date such as 1374843600. How can I set the date format using AngularJS directives? Is it possible?

When I tried to do it, I was getting a value of tag mydate -


Use format date filter like this:

<mydate>{{item.date | date:'yyyy-MM-dd HH:mm:ss Z'}}</mydate>