# isValidGtfsTime

Industry: Rail

:::caution[Unreleased]
Not in `@northguild/gmt` 1.21.0 on npm yet. It is on `main` and ships in the next release.
:::

## Signature

```ts
isValidGtfsTime(value: string): boolean
```

Checks a GTFS Schedule `Time` value, including one past `24:00:00`.

- True for `H:MM:SS`, `HH:MM:SS` and `HHH:MM:SS` with hours 0–999 and minutes and seconds `00`–`59`.
- `25:35:00` is valid: 1:35 on the following day, still on the same service day.
- Nothing is trimmed, so a space or newline makes it false; an empty field is false.
- True exactly when `parseGtfsTime` returns a value: both read the value with one internal core. Source: GTFS Schedule Reference § Field Types, Time.

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `value` | `string` | A GTFS `Time` field, such as `frequencies.txt` `start_time`. |

## Returns

`true` when `value` is a GTFS time, or `false` on invalid input

## Examples

```ts
import { isValidGtfsTime } from "@northguild/gmt/rail/validate";

isValidGtfsTime("25:35:00") // true
```

## Source

[rail/validate/isValidGtfsTime.ts](https://github.com/northguild/gmt/blob/main/packages/gmt/src/rail/validate/isValidGtfsTime.ts)
