# TimeFormatComplicationText

Artifact: [androidx.wear.watchface:watchface-complications-data](https://developer.android.com/jetpack/androidx/releases/wear-watchface) [View Source](https://cs.android.com/search?q=file:androidx/wear/watchface/complications/data/Text.kt+class:androidx.wear.watchface.complications.data.TimeFormatComplicationText) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0)

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/androidx/wear/watchface/complications/data/TimeFormatComplicationText "View this page in Java")


```
class TimeFormatComplicationText : ComplicationText
```

<br />

*** ** * ** ***

A `https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/data/ComplicationText` that shows a formatted time.

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/data/TimeFormatComplicationText.Builder` A builder for `https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/data/TimeFormatComplicationText`. |

| ### Public functions |
|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/data/TimeFormatComplicationText#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `open https://developer.android.com/reference/java/time/Instant.html` | `https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/data/TimeFormatComplicationText#getNextChangeTime(java.time.Instant)(afterInstant: https://developer.android.com/reference/java/time/Instant.html)` Returns the next time after `https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/data/ComplicationText#getNextChangeTime(java.time.Instant)` at which the text may change. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/data/TimeFormatComplicationText#getTextAt(android.content.res.Resources,java.time.Instant)(resources: https://developer.android.com/reference/android/content/res/Resources.html, instant: https://developer.android.com/reference/java/time/Instant.html)` Returns the text that should be displayed for the given timestamp. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/data/TimeFormatComplicationText#hashCode()()` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/data/TimeFormatComplicationText#isAlwaysEmpty()()` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/data/TimeFormatComplicationText#returnsSameText(java.time.Instant,java.time.Instant)(firstInstant: https://developer.android.com/reference/java/time/Instant.html, secondInstant: https://developer.android.com/reference/java/time/Instant.html)` Returns true if the result of `https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/data/ComplicationText#getTextAt(android.content.res.Resources,java.time.Instant)` will be the same for both `https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/data/ComplicationText#returnsSameText(java.time.Instant,java.time.Instant)` and `https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/data/ComplicationText#returnsSameText(java.time.Instant,java.time.Instant)`. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/data/TimeFormatComplicationText#toString()()` |

## Public functions

### equals

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

### getNextChangeTime

```
open fun getNextChangeTime(afterInstant: Instant): Instant
```

Returns the next time after `https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/data/ComplicationText#getNextChangeTime(java.time.Instant)` at which the text may change.

### getTextAt

```
open fun getTextAt(resources: Resources, instant: Instant): CharSequence
```

Returns the text that should be displayed for the given timestamp.

| Parameters |
|---|---|
| `resources: https://developer.android.com/reference/android/content/res/Resources.html` | `https://developer.android.com/reference/android/content/res/Resources.html` from the current context |
| `instant: https://developer.android.com/reference/java/time/Instant.html` | The `https://developer.android.com/reference/java/time/Instant.html` at which to sample the text |

### hashCode

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

### isAlwaysEmpty

```
open fun isAlwaysEmpty(): Boolean
```

### returnsSameText

```
open fun returnsSameText(firstInstant: Instant, secondInstant: Instant): Boolean
```

Returns true if the result of `https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/data/ComplicationText#getTextAt(android.content.res.Resources,java.time.Instant)` will be the same for both `https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/data/ComplicationText#returnsSameText(java.time.Instant,java.time.Instant)` and `https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/data/ComplicationText#returnsSameText(java.time.Instant,java.time.Instant)`.

### toString

```
open fun toString(): String
```