Programming · free software · the open webSubscribe via RSS

Why Can a Transit Service Day Extend Past Midnight?

From the earlier reference collection. Read the current software blog.

Transit schedules can keep one service day open after midnight, so a time such as 25:10 means 1:10 a.m. on the following calendar day.

A schedule day is not always a calendar day

A wall clock resets at midnight, but a transit trip may continue well beyond it. To keep an overnight run together, a schedule can count hours from the start of its service day. Under this convention, 25:10 means 25 hours and 10 minutes after the service day began: 1:10 a.m. on the next calendar date.

The value is elapsed schedule time, not a request to find a clock face with a 25 on it. If the service date is Friday, 25:10 falls on Saturday morning. The service date still identifies the schedule day to which the trip belongs.

Why keep the trip together?

Imagine a route whose service day starts at 8 a.m. A late trip leaves its first stop at 23:40 and reaches its final stop at 25:10. Treating the final arrival as part of the same service day makes the trip’s sequence clear: it starts late Friday and ends early Saturday, without splitting the trip at midnight.

GTFS allows a service day to exceed 24 hours, and its reference gives an example of a trip running from 08:00 on Friday to 02:00 on Saturday represented through 26:00. The exact meaning of a service day can vary by agency. [GTFS schedule reference](https://gtfs.org/documentation/schedule/reference/)

Convert the value without losing its meaning

For a simple display, split total minutes into whole days and a remainder. For 25:10, there is one full 24-hour period and 70 minutes left, which is 1:10. Add that day offset to the calendar date associated with the service date, then show the local clock time with a clear next-day label.

A tool can also retain the original schedule value and the derived date separately. That prevents later code from mistaking 01:10 Saturday for an unrelated trip whose service date is Saturday. The service date and arrival date answer different questions.

Read the label, not just the digits

When a timetable shows values above 24:00, read them as positions on an extended service-day timeline. If it instead shows ordinary clock times, look for an overnight marker or a date label to see where midnight falls.

This convention helps riders follow one trip across midnight and helps software preserve its ordering. The useful question is not whether 25:10 is a valid clock reading; it is which service date anchors that elapsed schedule time.

References

  1. GTFS Schedule Reference

Suggest a correction · All posts