Skip to content

isValidGtfsTime

  • Public transport timetables in GTFS feeds, where a stop time runs past midnight and still belongs to the service day its trip began on.
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.
ParameterTypeDescription
valuestringA GTFS Time field, such as frequencies.txt start_time.

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

import { isValidGtfsTime } from "@northguild/gmt/rail/validate";
isValidGtfsTime("25:35:00") // true
output 

rail/validate/isValidGtfsTime.ts

© 2026 NorthGuild · Licences

Code examples: MIT-0. Packages: MIT. Third-party data and components: their own licences, credited where they appear. Everything else: © 2026 NorthGuild, all rights reserved.