Question: Is there any way I can use the [moment.js](http://momentjs.com/) `format` method on duration objects? I can't find it anywhere in the docs and it doesn't seen to be an attribute on duration objects.

I'd like to be able to do something like:

```
var diff = moment(end).unix() - moment(start).unix();
moment.duration(diff).format('hh:mm:ss')

```

Also, if there are any other libraries which can easily accommodate this sort of functionality, I'd be interested in recommendations.

Thanks!

Answer: 
Use this plugin [Moment Duration Format](https://github.com/jsmreese/moment-duration-format).

Example:

```
moment.duration(123, "minutes").format("h:mm");

```
If you're willing to use a different javascript library, [numeral.js](http://numeraljs.com/) can format seconds as follows (example is for 1000 seconds):

```
var string = numeral(1000).format('00:00');
// '00:16:40'

```