Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angularjs: timestamp to formatted UTC time with date helper

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?

like image 208
sasa Avatar asked Dec 09 '13 12:12

sasa


1 Answers

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);  
    };  
});  
like image 127
2 revs Avatar answered Sep 28 '22 00:09

2 revs