XMLTV troubleshooting

How to represent a programme that ends after midnight

Use the next calendar date in an XMLTV stop timestamp when a programme crosses midnight, then compare start and stop in UTC.

Midnight belongs to a new date

If a Paris programme starts at 23:45 on 16 July 2026 and ends at 00:15, the end belongs to 17 July in Paris. Keeping 16 July in the stop field puts the stop before the start. The guide can display the programme with an incorrect duration or drop it from the grid.

The corrected local stop is 20260717001500 +0200. When both values are converted to UTC, this particular start and stop still fall on 16 July. Keeping local date conversion and UTC calculation separate prevents a second mistake.

FieldValueUTC equivalent
Start20260716234500 +020016 July 2026 at 21:45 UTC
Incorrect same-day stop20260716001500 +020015 July 2026 at 22:15 UTC
Correct next-day stop20260717001500 +020016 July 2026 at 22:15 UTC

Keep the whole timestamp through import

A schedule spreadsheet may show only the time of day. Keep a separate date or write the whole timestamp so the export can identify which midnight you mean. If the local offset changes between the start and the stop, attach the correct offset to each timestamp. For duration checks, subtract the UTC start from the UTC stop.

Here, the corrected interval is 30 minutes. A time-only calculation can return a negative duration and an automatic wrap may hide a bad date. Check the generated timestamps before adding any programme to a live guide.

Compare the programme before and after midnight

  1. Identify the station and its local zone. Record the intended start and stop date as well as time.
  2. Confirm the offset on both timestamps and convert each to UTC.
  3. Validate that the end is after the start and the computed duration fits the source schedule.
  4. Refresh the programme guide and check the last item before midnight, the cross-midnight item and the first item after it.

Sources and further reading