formatGtfsTime
Signature
Section titled “Signature”formatGtfsTime(value: GtfsTime): stringWrites a GTFS Schedule Time value, keeping the days past the service day in the hour.
- Writes
HH:MM:SSwith at least two hour digits:08:05:00, not8:05:00;110:29:00. dayOverflowadds 24 hours a day, so{ seconds: 5700, dayOverflow: 1 }is25:35:00, never01:35:00.- A value over
999:59:59cannot be written in three digits and returns"". - The argument is read like a property bag: any object, a function included; each member is read once, inherited members are read and extra members are ignored. Source: GTFS Schedule Reference § Field Types, Time.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value | GtfsTime | The written time less whole 24-hour blocks (seconds, 0–86399) and the whole days past the service day (dayOverflow, 0 or more). |
Returns
Section titled “Returns”The GTFS Time string, or "" on invalid input (not a GtfsTime, or past 999:59:59)
Related types
Section titled “Related types”Examples
Section titled “Examples”import { formatGtfsTime } from "@northguild/gmt/rail/format";
formatGtfsTime({ seconds: 5700, dayOverflow: 1 }) // "25:35:00"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.