Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/com/google/wear/services/complications/TimeFormatComplicationText.Builder#pubctors) \| [Methods](https://developer.android.com/reference/com/google/wear/services/complications/TimeFormatComplicationText.Builder#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/com/google/wear/services/complications/TimeFormatComplicationText.Builder#inhmethods)

# TimeFormatComplicationText.Builder


`
public
static
final

class
TimeFormatComplicationText.Builder
`


`

extends Object


`

`


`

|---|---|
| java.lang.Object ||
| ↳ | com.google.wear.services.complications.TimeFormatComplicationText.Builder |

<br />

*** ** * ** ***

Builder for `https://developer.android.com/reference/com/google/wear/services/complications/TimeFormatComplicationText`.

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/com/google/wear/services/complications/TimeFormatComplicationText.Builder#Builder()() ` |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/com/google/wear/services/complications/TimeFormatComplicationText` | ` https://developer.android.com/reference/com/google/wear/services/complications/TimeFormatComplicationText.Builder#build()() ` Builds a `https://developer.android.com/reference/com/google/wear/services/complications/TimeFormatComplicationText`. |
| ` https://developer.android.com/reference/com/google/wear/services/complications/TimeFormatComplicationText.Builder` | ` https://developer.android.com/reference/com/google/wear/services/complications/TimeFormatComplicationText.Builder#setFormat(java.lang.String)(String format) ` Sets the format that should be applied to the date. |
| ` https://developer.android.com/reference/com/google/wear/services/complications/TimeFormatComplicationText.Builder` | ` https://developer.android.com/reference/com/google/wear/services/complications/TimeFormatComplicationText.Builder#setStyle(int)(int style) ` Sets the style in which the time format part will be displayed. |
| ` https://developer.android.com/reference/com/google/wear/services/complications/TimeFormatComplicationText.Builder` | ` https://developer.android.com/reference/com/google/wear/services/complications/TimeFormatComplicationText.Builder#setSurroundingText(java.lang.CharSequence)(CharSequence surroundingText) ` Sets the string within which the time difference will be displayed. |
| ` https://developer.android.com/reference/com/google/wear/services/complications/TimeFormatComplicationText.Builder` | ` https://developer.android.com/reference/com/google/wear/services/complications/TimeFormatComplicationText.Builder#setTimeZone(android.icu.util.TimeZone)(TimeZone timeZone) ` Sets the time zone that will be used for the formatted time. |

| ### Inherited methods |
|---|---|
| From class ` java.lang.Object ` |---|---| | ` Object` | ` clone() ` | | ` boolean` | ` equals(Object arg0) ` | | ` void` | ` finalize() ` | | ` final Class<?>` | ` getClass() ` | | ` int` | ` hashCode() ` | | ` final void` | ` notify() ` | | ` final void` | ` notifyAll() ` | | ` String` | ` toString() ` | | ` final void` | ` wait(long arg0, int arg1) ` | | ` final void` | ` wait(long arg0) ` | | ` final void` | ` wait() ` | ||

## Public constructors

### Builder

```
public Builder ()
```

<br />

<br />

## Public methods

### build

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public TimeFormatComplicationText build ()
```

Builds a `https://developer.android.com/reference/com/google/wear/services/complications/TimeFormatComplicationText`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/com/google/wear/services/complications/TimeFormatComplicationText` | <br /> |

### setFormat

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public TimeFormatComplicationText.Builder setFormat (String format)
```

Sets the format that should be applied to the date. This should be a pattern as used by
`https://developer.android.com/reference/java/text/SimpleDateFormat`.

<br />

| Parameters ||
|---|---|
| `format` | `String` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/com/google/wear/services/complications/TimeFormatComplicationText.Builder` | <br /> |

### setStyle

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public TimeFormatComplicationText.Builder setStyle (int style)
```

Sets the style in which the time format part will be displayed. If not set, defaults to
`https://developer.android.com/reference/com/google/wear/services/complications/TimeFormatComplicationText#STYLE_DEFAULT`, which leaves the formatted date
unchanged.

<br />

| Parameters ||
|---|---|
| `style` | `int`: Value is one of the following: - `https://developer.android.com/reference/com/google/wear/services/complications/TimeFormatComplicationText#STYLE_DEFAULT` - `https://developer.android.com/reference/com/google/wear/services/complications/TimeFormatComplicationText#STYLE_UPPER_CASE` - `https://developer.android.com/reference/com/google/wear/services/complications/TimeFormatComplicationText#STYLE_LOWER_CASE` |

| Returns ||
|---|---|
| `https://developer.android.com/reference/com/google/wear/services/complications/TimeFormatComplicationText.Builder` | this builder for chaining. <br /> |

**See also:**

- `https://developer.android.com/reference/com/google/wear/services/complications/TimeFormatComplicationText#STYLE_DEFAULT`
- `https://developer.android.com/reference/com/google/wear/services/complications/TimeFormatComplicationText#STYLE_UPPER_CASE`
- `https://developer.android.com/reference/com/google/wear/services/complications/TimeFormatComplicationText#STYLE_LOWER_CASE`

### setSurroundingText

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public TimeFormatComplicationText.Builder setSurroundingText (CharSequence surroundingText)
```

Sets the string within which the time difference will be displayed. This is optional.

Within the text, `^1` will be replaced with the time format, so for example to
show a result like `"10:00: meeting"` the surrounding text would be `"^1:
meeting"`.

To use the `^` character within the text, escape it as `^^`.

If the text contains spans, some of them may not be rendered by the complication drawable. Supported spans
are `https://developer.android.com/reference/android/text/style/ForegroundColorSpan`, `https://developer.android.com/reference/android/text/style/LocaleSpan`, `https://developer.android.com/reference/android/text/style/SubscriptSpan`, `https://developer.android.com/reference/android/text/style/SuperscriptSpan`, `https://developer.android.com/reference/android/text/style/StyleSpan`, `https://developer.android.com/reference/android/text/style/StrikethroughSpan`, `https://developer.android.com/reference/android/text/style/TypefaceSpan` and
`https://developer.android.com/reference/android/text/style/UnderlineSpan`.

<br />

| Parameters ||
|---|---|
| `surroundingText` | `CharSequence`: string within which the time difference value will be displayed, with `^1` in place of the time difference. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/com/google/wear/services/complications/TimeFormatComplicationText.Builder` | this builder for chaining. <br /> |

### setTimeZone

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public TimeFormatComplicationText.Builder setTimeZone (TimeZone timeZone)
```

Sets the time zone that will be used for the formatted time. This is optional - if not
set, the system's default time zone will be used.

<br />

| Parameters ||
|---|---|
| `timeZone` | `TimeZone` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/com/google/wear/services/complications/TimeFormatComplicationText.Builder` | this builder for chaining. <br /> |