Angularjs: timestamp to formatted UTC time with date helper
Asked Answered
I

1

12

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?

Interradial answered 9/12, 2013 at 12:1 Comment(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() acceptsAdventurism
T
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);  
    };  
});  
Tightwad answered 9/12, 2013 at 12:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.