parseGtfsTime
Signature
Section titled “Signature”parseGtfsTime(value: string): GtfsTime | nullReads a GTFS Schedule Time value, keeping the days past the service day apart from the time of day.
- Reads
HH:MM:SS,H:MM:SSandHHH:MM:SS, hours up to 999; minutes and seconds00to59. 25:35:00is 1:35 on the following day, still on the service day:dayOverflowcounts the whole 24-hour blocks andsecondsis what is left: the written time less those blocks.- Nothing is trimmed: a space, tab, newline or byte order mark returns
null. - Reads the
Timetype only, not GTFSLocal time(timeframes.txt). - Resolves no local time and needs no zone; that is the job of the service date and the agency’s zone. Source: GTFS Schedule Reference § Field Types, Time.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value | string | A GTFS Time field, such as stop_times.txt arrival_time. |
Returns
Section titled “Returns”The written time less whole 24-hour blocks (seconds) and those blocks (dayOverflow), or null on invalid input (an empty field included)
Related types
Section titled “Related types”Examples
Section titled “Examples”import { parseGtfsTime } from "@northguild/gmt/rail/parse";
parseGtfsTime("25:35:00") // { seconds: 5700, dayOverflow: 1 }Source
Section titled “Source”© 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.