javascript - Angularjs: timestamp to formatted UTC time with date helper - Stack Overflow

I'm looking for idea how to format unix timestamp with AngularJS date helper?In official documenta

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
Add a ment  | 

1 Answer 1

Reset to default 6

I'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);  
    };  
});  

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744053004a4550416.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信