admin管理员组文章数量:1181439
I learned that one can transform a unix time stamp into a date by using date filter from this post: AngularJS. Convert tag value (Unix time to human-readable time)
But I can not convert mine with it...
<td>{{contract.start_date_unix | date:'MM-dd-yyyy'}}</td>
inside the contract.start_date_unix
, its valued at 1406779200
I checked it with a checker that it shows exactly what I want: Thu, 31 Jul 2014 04:00:00 GMT (but of course, the format I want is MM-dd-yyyy, the date is correct and that's what I try to prove here)
But when I do the date filter above, it will only show 01-17-1970
or 01-16-1970
...
What could be the issue cause this?
I learned that one can transform a unix time stamp into a date by using date filter from this post: AngularJS. Convert tag value (Unix time to human-readable time)
But I can not convert mine with it...
<td>{{contract.start_date_unix | date:'MM-dd-yyyy'}}</td>
inside the contract.start_date_unix
, its valued at 1406779200
I checked it with a checker that it shows exactly what I want: Thu, 31 Jul 2014 04:00:00 GMT (but of course, the format I want is MM-dd-yyyy, the date is correct and that's what I try to prove here)
But when I do the date filter above, it will only show 01-17-1970
or 01-16-1970
...
What could be the issue cause this?
Share Improve this question edited May 23, 2017 at 11:54 CommunityBot 11 silver badge asked Aug 27, 2014 at 18:39 ey dee ey emey dee ey em 8,59315 gold badges72 silver badges127 bronze badges 01 Answer
Reset to default 37the time shown is epoch and not actual date. please read the links in your question, answer is there in one of the links.
you need to multiply the time by 1000.
<td>{{contract.start_date_unix * 1000 | date:'MM-dd-yyyy'}}</td>
本文标签: javascriptAngularJS UnixTime to DateTime Format with date filter failedStack Overflow
版权声明:本文标题:javascript - AngularJS UnixTime to DateTime Format with date filter failed - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738168946a2066945.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论