# isoTime

> This document is the Markdown version of [valibot.dev/api/isoTime/](https://valibot.dev/api/isoTime/). For the complete documentation index, see [llms.txt](https://valibot.dev/llms.txt).

Creates an [ISO time](https://en.wikipedia.org/wiki/ISO_8601) validation action.

Format: `hh:mm`

```ts
const Action = v.isoTime<TInput, TMessage>(message);
```

## Generics

- `TInput` `extends string`
- `TMessage` `extends ErrorMessage<IsoTimeIssue<TInput>> | undefined`

## Parameters

- `message` `TMessage`

### Explanation

With `isoTime` you can validate the formatting of a string. If the input is not an ISO time, you can use `message` to customize the error message.

## Returns

- `Action` `IsoTimeAction<TInput, TMessage>`

## Examples

The following examples show how `isoTime` can be used.

### ISO time schema

Schema to validate an ISO time.

```ts
const IsoTimeSchema = v.pipe(
  v.string(),
  v.isoTime('The time is badly formatted.')
);
```

## Related

The following APIs can be combined with `isoTime`.

### Schemas

[`any`](/api/any.md), [`custom`](/api/custom.md), [`string`](/api/string.md)

### Methods

[`pipe`](/api/pipe.md)

### Utils

[`isOfKind`](/api/isOfKind.md), [`isOfType`](/api/isOfType.md)
