angular.js - How to format string type time in angularjs
PHPz
PHPz 2017-05-15 17:12:40
0
1
913

The time I got is a string type Feb 21, 2017 5:10:09 PM
I want to format this character into "yyyy-MM-dd"
It is useless to write like this: {{data.time | date:'yyyy-MM-dd'}}
Solve

PHPz
PHPz

学习是最好的投资!

reply all(1)
巴扎黑

var time = new Date("Feb 21, 2017 5:10:09 PM") ;
var YMD = $filter('date')(time, 'yyyy-MM-dd');

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template