AngularJS: How to print out duration time with format?

angularjs, javascript

Solution

The `date` filter formats a Unix timestamp (in milliseconds), so it doesn't work on durations.

You'll have to do manual formatting, like you suggest.

Problem

I use below code to print the time duration: ``` {{(endTime - startTime) * 1000 | date: 'H:mm:ss'}} ``` But I get the time of GMT +8 AngularJS has any way to print out the non-convert duaration, Or I need to use this way to do this? ``` {{(endTime - startTime) % (60 * 60 * 24) / (60 * 60) | number: 0}}: {{(endTime - startTime) % (60 * 60) / 60 | number: 0}}: {{(endTime - startTime) % 60 | number: 0}} ```

Original source