# DynamicBuilders.DynamicDuration

Artifact: [androidx.wear.protolayout:protolayout-expression](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/expression/DynamicBuilders.java+class:androidx.wear.protolayout.expression.DynamicBuilders.DynamicDuration) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

*** ** * ** ***

<br />

```
@RequiresSchemaVersion(major = 1, minor = 200)
public interface DynamicBuilders.DynamicDuration extends DynamicBuilders.DynamicType
```

<br />

*** ** * ** ***

Interface defining a dynamic duration type.

## Summary

| ### Public methods |
|---|---|
| `default static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 300) https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration#from(androidx.wear.protolayout.expression.DynamicDataKey<androidx.wear.protolayout.expression.DynamicBuilders.DynamicDuration>)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicDataKey<https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration> dynamicDataKey )` Creates a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration` that is bound to the value of an item of the State. |
| `default static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration` | `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration#fromByteArray(byte[])(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html byte[] byteArray)` Creates a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration` from a byte array generated by `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration#toDynamicDurationByteArray()`. |
| `default static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration` | `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration#fromByteArray(byte[],int,int)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html byte[] byteArray, int offset, int length)` Creates a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration` from the provided byte array at the provided offset and length, that was generated by one of the `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration#toDynamicDurationByteArray()` overloads. |
| `default @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration#getHoursPart()()` Returns the number of hours part in the duration as a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32`. |
| `default @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration#getIntDaysPart()()` Returns the total number of days in a duration as a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32`. |
| `default @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration#getMinutesPart()()` Returns the number of minutes part in the duration as a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32`. |
| `default @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration#getSecondsPart()()` Returns the number of seconds part in the duration as a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32`. |
| `default static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/ConditionScopes.ConditionScope<https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration, https://developer.android.com/reference/java/time/Duration.html>` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration#onCondition(androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicBool condition)` Bind the value of this `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration` to the result of a conditional expression. |
| `default @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html byte[]` | `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration#toDynamicDurationByteArray()()` Serializes the `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration` into a new byte array that can later be used with `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration#fromByteArray(byte[])`. |
| `default int` | `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration#toDynamicDurationByteArray(byte[])(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html byte[] byteArray)` Serializes the `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration` into the provided byte array, returning the amount of bytes written, that can later be used with `DynamicDuration.fromByteArray( byteArray, 0, bytesWritten)`. |
| `default int` | `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration#toDynamicDurationByteArray(byte[],int,int)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html byte[] byteArray, int offset, int length )` Serializes the `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration` into the provided byte array, returning the amount of bytes written, limited by the provided offset and length, that can later be used with `DynamicDuration.fromByteArray(byteArray, offset, bytesWritten)`. |
| `default @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration#toIntDays()()` Returns the total number of days in a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration` as a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32`. |
| `default @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration#toIntHours()()` Returns the total number of hours in a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration` as a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32`. |
| `default @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration#toIntMinutes()()` Returns the total number of minutes in a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration` as a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32`. |
| `default @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration#toIntSeconds()()` Returns the total number of seconds in a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration` as a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32`. |
| `default static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration#withSecondsPrecision(java.time.Duration)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/time/Duration.html duration)` Creates a constant-valued `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration` from a `https://developer.android.com/reference/java/time/Duration.html`. |

## Public methods

### from

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.1.0)

```
@RequiresSchemaVersion(major = 1, minor = 300)
default static @NonNull DynamicBuilders.DynamicDuration from(
    @NonNull DynamicDataKey<DynamicBuilders.DynamicDuration> dynamicDataKey
)
```

Creates a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration` that is bound to the value of an item of the State.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicDataKey<https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration> dynamicDataKey` | The source key to a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicDataBuilders.DynamicDataValue` with an `https://developer.android.com/reference/java/time/Duration.html` value. |

### fromByteArray

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

```
default static @NonNull DynamicBuilders.DynamicDuration fromByteArray(@NonNull byte[] byteArray)
```

Creates a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration` from a byte array generated by `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration#toDynamicDurationByteArray()`.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | if the byte array does not contain a valid serialization |

### fromByteArray

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

```
default static @NonNull DynamicBuilders.DynamicDuration fromByteArray(@NonNull byte[] byteArray, int offset, int length)
```

Creates a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration` from the provided byte array at the provided offset and length, that was generated by one of the `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration#toDynamicDurationByteArray()` overloads.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | if the byte array does not contain a valid serialization in the provided offset and length |

### getHoursPart

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

```
@RequiresSchemaVersion(major = 1, minor = 200)
default @NonNull DynamicBuilders.DynamicInt32 getHoursPart()
```

Returns the number of hours part in the duration as a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32`. This represents the absolute value of remaining hours when dividing total hours by hours in a day (24 hours); As an example, the following is equal to ` DynamicInt32.constant(10)`

```
  DynamicInstant.withSecondsPrecision(Instant.EPOCH)
     .durationUntil(DynamicInstant.withSecondsPrecision(Instant.ofEpochSecond(123456L)))
     .getHoursPart();
```

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32` | a new instance of `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32` containing the result of the operation. |

### getIntDaysPart

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

```
@RequiresSchemaVersion(major = 1, minor = 200)
default @NonNull DynamicBuilders.DynamicInt32 getIntDaysPart()
```

Returns the total number of days in a duration as a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32`. This represents the absolute value of the total number of days in the duration based on the 24 hours day definition. The fraction part of the result will be truncated; As an example, the following is equal to `DynamicInt32.constant(1)`

```
  DynamicInstant.withSecondsPrecision(Instant.EPOCH)
     .durationUntil(DynamicInstant.withSecondsPrecision(Instant.ofEpochSecond(123456L)))
     .getIntDaysPart();
```

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32` | a new instance of `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32` containing the result of the operation. Integer overflow can occur if the result of the operation is larger than `https://developer.android.com/reference/java/lang/Integer.html#MAX_VALUE`. |

### getMinutesPart

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

```
@RequiresSchemaVersion(major = 1, minor = 200)
default @NonNull DynamicBuilders.DynamicInt32 getMinutesPart()
```

Returns the number of minutes part in the duration as a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32`. This represents the absolute value of remaining minutes when dividing total minutes by minutes in an hour (60 minutes). As an example, the following is equal to ` DynamicInt32.constant(17)`

```
  DynamicInstant.withSecondsPrecision(Instant.EPOCH)
     .durationUntil(DynamicInstant.withSecondsPrecision(Instant.ofEpochSecond(123456L)))
     .getMinutesPart();
```

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32` | a new instance of `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32` containing the result of the operation. |

### getSecondsPart

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

```
@RequiresSchemaVersion(major = 1, minor = 200)
default @NonNull DynamicBuilders.DynamicInt32 getSecondsPart()
```

Returns the number of seconds part in the duration as a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32`. This represents the absolute value of remaining seconds when dividing total seconds by seconds in a minute (60 seconds); As an example, the following is equal to ` DynamicInt32.constant(36)`

```
  DynamicInstant.withSecondsPrecision(Instant.EPOCH)
     .durationUntil(DynamicInstant.withSecondsPrecision(Instant.ofEpochSecond(123456L)))
     .getSecondsPart();
```

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32` | a new instance of `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32` containing the result of the operation. |

### onCondition

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

```
@RequiresSchemaVersion(major = 1, minor = 200)
default static @NonNull ConditionScopes.ConditionScope<DynamicBuilders.DynamicDuration, Duration> onCondition(@NonNull DynamicBuilders.DynamicBool condition)
```

Bind the value of this `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration` to the result of a conditional expression. This will use the value given in either `https://developer.android.com/reference/androidx/wear/protolayout/expression/ConditionScopes.ConditionScope#use(T)` or `https://developer.android.com/reference/androidx/wear/protolayout/expression/ConditionScopes.IfTrueScope#elseUse(T)` depending on the value yielded from ` condition`.

### toDynamicDurationByteArray

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

```
default @NonNull byte[] toDynamicDurationByteArray()
```

Serializes the `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration` into a new byte array that can later be used with `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration#fromByteArray(byte[])`.

### toDynamicDurationByteArray

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

```
default int toDynamicDurationByteArray(@NonNull byte[] byteArray)
```

Serializes the `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration` into the provided byte array, returning the amount of bytes written, that can later be used with `DynamicDuration.fromByteArray( byteArray, 0, bytesWritten)`.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | if the byte array is too small |

### toDynamicDurationByteArray

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

```
default int toDynamicDurationByteArray(
    @NonNull byte[] byteArray,
    int offset,
    int length
)
```

Serializes the `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration` into the provided byte array, returning the amount of bytes written, limited by the provided offset and length, that can later be used with `DynamicDuration.fromByteArray(byteArray, offset, bytesWritten)`.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | if the byte array is too small |

### toIntDays

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

```
@RequiresSchemaVersion(major = 1, minor = 200)
default @NonNull DynamicBuilders.DynamicInt32 toIntDays()
```

Returns the total number of days in a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration` as a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32`. The fraction part of the result will be truncated. This is based on the standard definition of a day as 24 hours. As an example, the following is equal to ` DynamicInt32.constant(1)`

```
  DynamicInstant.withSecondsPrecision(Instant.EPOCH)
     .durationUntil(DynamicInstant.withSecondsPrecision(Instant.ofEpochSecond(123456L)))
     .toIntDays();
```

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32` | a new instance of `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32` containing the result of the operation. Integer overflow can occur if the result of the operation is larger than `https://developer.android.com/reference/java/lang/Integer.html#MAX_VALUE`. |

### toIntHours

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

```
@RequiresSchemaVersion(major = 1, minor = 200)
default @NonNull DynamicBuilders.DynamicInt32 toIntHours()
```

Returns the total number of hours in a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration` as a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32`. The fraction part of the result will be truncated. As an example, the following is equal to `DynamicInt32.constant(34)`

```
  DynamicInstant.withSecondsPrecision(Instant.EPOCH)
     .durationUntil(DynamicInstant.withSecondsPrecision(Instant.ofEpochSecond(123456L)))
     .toIntHours();
```

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32` | a new instance of `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32` containing the result of the operation. Integer overflow can occur if the result of the operation is larger than `https://developer.android.com/reference/java/lang/Integer.html#MAX_VALUE`. |

### toIntMinutes

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

```
@RequiresSchemaVersion(major = 1, minor = 200)
default @NonNull DynamicBuilders.DynamicInt32 toIntMinutes()
```

Returns the total number of minutes in a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration` as a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32`. The fraction part of the result will be truncated. As an example, the following is equal to `DynamicInt32.constant(2057)`

```
  DynamicInstant.withSecondsPrecision(Instant.EPOCH)
     .durationUntil(DynamicInstant.withSecondsPrecision(Instant.ofEpochSecond(123456L)))
     .toIntMinutes();
```

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32` | a new instance of `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32` containing the result of the operation. Integer overflow can occur if the result of the operation is larger than `https://developer.android.com/reference/java/lang/Integer.html#MAX_VALUE`. |

### toIntSeconds

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

```
@RequiresSchemaVersion(major = 1, minor = 200)
default @NonNull DynamicBuilders.DynamicInt32 toIntSeconds()
```

Returns the total number of seconds in a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration` as a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32`. As an example, the following is equal to ` DynamicInt32.constant(123456)`

```
  DynamicInstant.withSecondsPrecision(Instant.EPOCH)
     .durationUntil(DynamicInstant.withSecondsPrecision(Instant.ofEpochSecond(123456L)))
     .toIntSeconds();
```

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32` | a new instance of `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32` containing the result of the operation. Integer overflow can occur if the result of the operation is larger than `https://developer.android.com/reference/java/lang/Integer.html#MAX_VALUE`. |

### withSecondsPrecision

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

```
@RequiresSchemaVersion(major = 1, minor = 200)
default static @NonNull DynamicBuilders.DynamicDuration withSecondsPrecision(@NonNull Duration duration)
```

Creates a constant-valued `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration` from a `https://developer.android.com/reference/java/time/Duration.html`. If `https://developer.android.com/reference/java/time/Duration.html` precision is greater than seconds, then any excess precision information will be dropped.