Angularjs: timestamp to formatted UTC time with date helper

前端 未结 1 1839
执念已碎
执念已碎 2021-01-11 13:10

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

相关标签:
1条回答
  • 2021-01-11 13:49

    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);  
        };  
    });  
    
    0 讨论(0)
提交回复
热议问题