admin管理员组文章数量:1326066
Updated at : {{res.updated_at}}
Value: {"updated_at":"2017-04-12T21:46:20Z"}
I need to change this 2017-04-12T21:46:20Z
to 2017-04-12 21:46:20
by removing T
and Z
. Please help how to achieve this. The code is in angular js.
Updated at : {{res.updated_at}}
Value: {"updated_at":"2017-04-12T21:46:20Z"}
I need to change this 2017-04-12T21:46:20Z
to 2017-04-12 21:46:20
by removing T
and Z
. Please help how to achieve this. The code is in angular js.
-
Try:
d = "2017-04-12T21:46:20Z"; d=d.replace(/[T]/, ' ');d=d.replace(/[Z]/, '');
– TheChetan Commented May 9, 2017 at 8:07
3 Answers
Reset to default 5Try to:
{{res.updated_at| date : 'yyyy-MM-dd HH:mm:ss'}}
Detail format at: https://docs.angularjs/api/ng/filter/date
I don't know if it's specific to angular, but this formatting pattern should work.
yyyy-MM-dd hh:mm:ss
This should format the date as 2017-04-12 21:46:20
"2017-04-12T21:46:20Z".split("T").join(" ").split("Z").join("")
本文标签: javascriptFormatting timestamp in Angular JSStack Overflow
版权声明:本文标题:javascript - Formatting timestamp in Angular JS - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742197542a2431353.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论