admin 管理员组文章数量: 1086019
I'm looking for idea how to format unix timestamp with AngularJS date helper?
In official documentation, there is only explanation for string inputs (If no timezone is specified in the string input, the time is considered to be in the local timezone), but what about timestamp? Any hint?
I'm looking for idea how to format unix timestamp with AngularJS date helper?
In official documentation, there is only explanation for string inputs (If no timezone is specified in the string input, the time is considered to be in the local timezone), but what about timestamp? Any hint?
Share Improve this question edited Feb 13, 2014 at 16:42 Paul Sweatte 24.6k7 gold badges131 silver badges268 bronze badges asked Dec 9, 2013 at 12:01 sasasasa 2,4436 gold badges23 silver badges35 bronze badges 1-
suggest you add specific examples of input / output. Docs aren't specific about string inputs, will accept any valid input that javascript
new Date()
accepts – charlietfl Commented Dec 9, 2013 at 13:47
1 Answer
Reset to default 6I've found some solution with custom filter and momentjs library:
app.filter('moment', function() {
return function(input, format) {
return moment(parseInt(input)).utc().format(format);
};
});
本文标签: javascriptAngularjs timestamp to formatted UTC time with date helperStack Overflow
版权声明:本文标题:javascript - Angularjs: timestamp to formatted UTC time with date helper - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://roclinux.cn/p/1744053006a2525360.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论