Reputation: 37
I have a string with a full date like this: "2016/03/05 13:47:18 +0000"
.
I want covert it to "2016-03-05"
or "05-March-2016"
on Angular scope. I also have integer time duration = 421471
which I want to convert to a time format like "23:45"
or "1 hour , 50 minute"
.
{{sound.created_at | date}}
{{sound.duration}}
How can I do that?
Upvotes: 0
Views: 235
Reputation: 2263
To solve your issue please use momentjs as very famous lib to deal everything about date in js.
To make it work well with Angularjs/4, please have a look here.
Upvotes: 1