---
title: formatDuration
framework: TVMLKit JS
role: symbol
role_heading: Function
platforms: [tvOS 9.0+]
path: tvmljs/1627346-formatduration
---

# formatDuration

Formats the given duration into the standard tvOS format.

## Declaration

```data
String formatDuration(
    in int duration
);
```

## Parameters

- `duration`: An integer specifying the duration, in seconds.

## Return Value

Return Value A string containing the formatted duration.

## Discussion

Discussion This function changes a number of seconds into the standard hour:minute:second format. For example, formatDuration(90) returns “1:30”.

## See Also

### Formatting Information

- [formatDate](tvmljs/1627445-formatdate.md)
- [formatNumber](tvmljs/1627348-formatnumber.md)
