# TimeFormat

Artifact: [androidx.media3:media3-ui-compose-material3](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/ui/compose/material3/indicator/TimeText.kt+class:androidx.media3.ui.compose.material3.indicator.TimeFormat)


```
@UnstableApi
class TimeFormat
```

<br />

*** ** * ** ***

A class for specifying the format of the time to be displayed by `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/indicators/TimeText.composable#TimeText(androidx.media3.common.Player,kotlin.Int,kotlinx.coroutines.CoroutineScope,kotlin.Function1)`.

Instances of this class can be created using the factory methods, such as `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/material3/indicator/TimeFormat#position()`, `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/material3/indicator/TimeFormat#duration()`, `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/material3/indicator/TimeFormat#remaining(kotlin.Boolean)`, and `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/material3/indicator/TimeFormat#positionAndDuration(kotlin.String)`.

## Summary

| ### Public companion functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/material3/indicator/TimeFormat` | `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/material3/indicator/TimeFormat#duration()()` Creates a `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/material3/indicator/TimeFormat` that displays the total duration of the media. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/material3/indicator/TimeFormat` | `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/material3/indicator/TimeFormat#position()()` Creates a `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/material3/indicator/TimeFormat` that displays the current position of the player. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/material3/indicator/TimeFormat` | `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/material3/indicator/TimeFormat#positionAndDuration(kotlin.String)(separator: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Creates a `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/material3/indicator/TimeFormat` that displays both the current position and the total duration. |
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/material3/indicator/TimeFormat` | `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/material3/indicator/TimeFormat#remaining(kotlin.Boolean)(showNegative: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Creates a `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/material3/indicator/TimeFormat` that displays the remaining time of the media. |

| ### Public functions |
|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/material3/indicator/TimeFormat#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/material3/indicator/TimeFormat#hashCode()()` |

## Public companion functions

### duration

```
fun duration(): TimeFormat
```

Creates a `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/material3/indicator/TimeFormat` that displays the total duration of the media.

### position

```
fun position(): TimeFormat
```

Creates a `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/material3/indicator/TimeFormat` that displays the current position of the player.

### positionAndDuration

```
fun positionAndDuration(separator: String = " / "): TimeFormat
```

Creates a `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/material3/indicator/TimeFormat` that displays both the current position and the total duration.

| Parameters |
|---|---|
| `separator: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html = " / "` | The separator string to be used between the current position and duration. |

### remaining

```
fun remaining(showNegative: Boolean = false): TimeFormat
```

Creates a `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/material3/indicator/TimeFormat` that displays the remaining time of the media.

| Parameters |
|---|---|
| `showNegative: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = false` | Whether to display the remaining time with a minus sign. |

## Public functions

### equals

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

```
open fun hashCode(): Int
```