# DynamicBuilders.DynamicInstant

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.DynamicInstant) 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.DynamicInstant extends DynamicBuilders.DynamicType
```

<br />

*** ** * ** ***

Interface defining a dynamic time instant type.

`https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInstant` precision is seconds. Thus, any time or duration operation will operate on that precision level.

## Summary

| ### Public methods |
|---|---|
| `default @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.DynamicInstant#durationUntil(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInstant)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInstant to)` Returns duration between the two `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInstant` instances as a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration`. |
| `default static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInstant` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 300) https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInstant#from(androidx.wear.protolayout.expression.DynamicDataKey<androidx.wear.protolayout.expression.DynamicBuilders.DynamicInstant>)( @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.DynamicInstant> dynamicDataKey )` Creates a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInstant` 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.DynamicInstant` | `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInstant#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.DynamicInstant` from a byte array generated by `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInstant#toDynamicInstantByteArray()`. |
| `default static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInstant` | `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInstant#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.DynamicInstant` 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.DynamicInstant#toDynamicInstantByteArray()` 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 = 300) https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInstant#getDayOfMonth(java.time.ZoneId)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/time/ZoneId.html zoneId)` Returns the day-of-month field from 1 to 31 following the ISO-8601 calendar system; As an example, the following is equal to `DynamicInt32.constant(1)`: |
| `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 = 300) https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInstant#getDayOfWeek(java.time.ZoneId)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/time/ZoneId.html zoneId)` Returns the day-of-week field going from MONDAY (1) to SUNDAY (7) following the ISO-8601 calendar system; As an example, the following is equal to ` DynamicInt32.constant(4)`: |
| `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 = 300) https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInstant#getHour(java.time.ZoneId)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/time/ZoneId.html zoneId)` Returns the hour-of-day field from 0 to 23 following the ISO-8601 calendar system; As an example, the following is equal to `DynamicInt32.constant(3)`: |
| `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 = 300) https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInstant#getMinute(java.time.ZoneId)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/time/ZoneId.html zoneId)` Returns the minute-of-hour field from 0 to 59 following the ISO-8601 calendar system; As an example, the following is equal to `DynamicInt32.constant(20)`: |
| `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 = 300) https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInstant#getMonth(java.time.ZoneId)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/time/ZoneId.html zoneId)` Returns the month-of-year field from 1 to 12 following the ISO-8601 calendar system; As an example, the following is equal to `DynamicInt32.constant(1)`: |
| `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 = 300) https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInstant#getSecond(java.time.ZoneId)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/time/ZoneId.html zoneId)` Returns the second-of-minute field from 0 to 59 following the ISO-8601 calendar system; As an example, the following is equal to `DynamicInt32.constant(10)`: |
| `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 = 300) https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInstant#getYear(java.time.ZoneId)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/time/ZoneId.html zoneId)` Returns the year field following the ISO-8601 calendar system; As an example, the following is equal to `DynamicInt32.constant(1970)`: |
| `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.DynamicInstant, https://developer.android.com/reference/java/time/Instant.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.DynamicInstant#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.DynamicInstant` to the result of a conditional expression. |
| `default static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInstant` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInstant#platformTimeWithSecondsPrecision()()` Creates a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInstant` that updates its value periodically from the system time. |
| `default @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html byte[]` | `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInstant#toDynamicInstantByteArray()()` Serializes the `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInstant` into a new byte array that can later be used with `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInstant#fromByteArray(byte[])`. |
| `default int` | `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInstant#toDynamicInstantByteArray(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.DynamicInstant` into the provided byte array, returning the amount of bytes written, that can later be used with `DynamicInstant.fromByteArray( byteArray, 0, bytesWritten)`. |
| `default int` | `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInstant#toDynamicInstantByteArray(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.DynamicInstant` into the provided byte array, returning the amount of bytes written, limited by the provided offset and length, that can later be used with `DynamicInstant.fromByteArray(byteArray, offset, bytesWritten)`. |
| `default static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInstant` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInstant#withSecondsPrecision(java.time.Instant)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/time/Instant.html instant)` Creates a constant-valued `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInstant` from an `https://developer.android.com/reference/java/time/Instant.html`. |

## Public methods

### durationUntil

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.DynamicDuration durationUntil(@NonNull DynamicBuilders.DynamicInstant to)
```

Returns duration between the two `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInstant` instances as a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicDuration`. The resulted duration is inclusive of the start instant and exclusive of the end; As an example, the following expression yields a duration object representing 10 seconds:

```
  DynamicInstant.withSecondsPrecision(Instant.ofEpochSecond(10L))
     .durationUntil(DynamicInstant.withSecondsPrecision(Instant.ofEpochSecond(20L)));
```

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

### 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.DynamicInstant from(
    @NonNull DynamicDataKey<DynamicBuilders.DynamicInstant> dynamicDataKey
)
```

Creates a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInstant` 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.DynamicInstant> 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/Instant.html` value. |

### fromByteArray

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

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

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

| 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.DynamicInstant fromByteArray(@NonNull byte[] byteArray, int offset, int length)
```

Creates a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInstant` 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.DynamicInstant#toDynamicInstantByteArray()` 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 |

### getDayOfMonth

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

```
@RequiresSchemaVersion(major = 1, minor = 300)
default @NonNull DynamicBuilders.DynamicInt32 getDayOfMonth(@NonNull ZoneId zoneId)
```

Returns the day-of-month field from 1 to 31 following the ISO-8601 calendar system; As an example, the following is equal to `DynamicInt32.constant(1)`:

```
  DynamicInstant.withSecondsPrecision(Instant.ofEpochSecond(8410))
     .getDayOfMonth(ZoneId.of("Europe/London"));
```

### getDayOfWeek

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

```
@RequiresSchemaVersion(major = 1, minor = 300)
default @NonNull DynamicBuilders.DynamicInt32 getDayOfWeek(@NonNull ZoneId zoneId)
```

Returns the day-of-week field going from MONDAY (1) to SUNDAY (7) following the ISO-8601 calendar system; As an example, the following is equal to ` DynamicInt32.constant(4)`:

```
  DynamicInstant.withSecondsPrecision(Instant.ofEpochSecond(8410))
     .getDayOfWeek(ZoneId.of("Europe/London"));
```

### getHour

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

```
@RequiresSchemaVersion(major = 1, minor = 300)
default @NonNull DynamicBuilders.DynamicInt32 getHour(@NonNull ZoneId zoneId)
```

Returns the hour-of-day field from 0 to 23 following the ISO-8601 calendar system; As an example, the following is equal to `DynamicInt32.constant(3)`:

```
  DynamicInstant.withSecondsPrecision(Instant.ofEpochSecond(8410))
     .getHour(ZoneId.of("Europe/London"));
```

### getMinute

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

```
@RequiresSchemaVersion(major = 1, minor = 300)
default @NonNull DynamicBuilders.DynamicInt32 getMinute(@NonNull ZoneId zoneId)
```

Returns the minute-of-hour field from 0 to 59 following the ISO-8601 calendar system; As an example, the following is equal to `DynamicInt32.constant(20)`:

```
  DynamicInstant.withSecondsPrecision(Instant.ofEpochSecond(8410))
     .getMinute(ZoneId.of("Europe/London"));
```

### getMonth

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

```
@RequiresSchemaVersion(major = 1, minor = 300)
default @NonNull DynamicBuilders.DynamicInt32 getMonth(@NonNull ZoneId zoneId)
```

Returns the month-of-year field from 1 to 12 following the ISO-8601 calendar system; As an example, the following is equal to `DynamicInt32.constant(1)`:

```
  DynamicInstant.withSecondsPrecision(Instant.ofEpochSecond(8410))
     .getMonth(ZoneId.of("Europe/London"));
```

### getSecond

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

```
@RequiresSchemaVersion(major = 1, minor = 300)
default @NonNull DynamicBuilders.DynamicInt32 getSecond(@NonNull ZoneId zoneId)
```

Returns the second-of-minute field from 0 to 59 following the ISO-8601 calendar system; As an example, the following is equal to `DynamicInt32.constant(10)`:

```
  DynamicInstant.withSecondsPrecision(Instant.ofEpochSecond(8410))
     .getSecond(ZoneId.of("Europe/London"));
```

### getYear

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

```
@RequiresSchemaVersion(major = 1, minor = 300)
default @NonNull DynamicBuilders.DynamicInt32 getYear(@NonNull ZoneId zoneId)
```

Returns the year field following the ISO-8601 calendar system; As an example, the following is equal to `DynamicInt32.constant(1970)`:

```
  DynamicInstant.withSecondsPrecision(Instant.ofEpochSecond(8410))
     .getYear(ZoneId.of("Europe/London"));
```

### 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.DynamicInstant, Instant> onCondition(@NonNull DynamicBuilders.DynamicBool condition)
```

Bind the value of this `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInstant` 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`.

### platformTimeWithSecondsPrecision

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.DynamicInstant platformTimeWithSecondsPrecision()
```

Creates a `https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInstant` that updates its value periodically from the system time.

### toDynamicInstantByteArray

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

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

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

### toDynamicInstantByteArray

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

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

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

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

### toDynamicInstantByteArray

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

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

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

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

### 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.DynamicInstant withSecondsPrecision(@NonNull Instant instant)
```

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