Chart RS-26 · FN-04 2026-11-19 · 4 min read
Chart lighting

Field note FN-04

Every day is somebody's local day: the hard parts of a flight log

Time zones, overnight flights, the date line, codeshares and airports that change their codes. The bugs SkyJourney's flight log taught me.

Project · SkyJourney →

A flight has two clocks. It leaves at 08:50 by one and lands at 13:05 by another, and both are true. Most of the bugs in SkyJourney’s flight log have come from code that quietly treated one clock as the other.

Store instants, show wall clocks

The model is simple, and I’d choose it again. Every flight time is stored as a UTC instant, and every airport carries a named time zone, so offsets and daylight saving come from the zone database, not from me. A time is converted only on the way in and on the way out, always in the zone of the airport it belongs to.

Even “arrival after departure” has to follow that model. Tokyo 20:00 → Honolulu 08:15 on the same date looks impossible as wall clocks, because it lands “before” it leaves. As instants, it’s a flight of seven and a quarter hours.

Almost every bug since has been a place where code quietly assumed that the UTC date, or the UTC hour, was the local one.

The UTC date is nobody’s date

JL502 leaves Sapporo at 08:50 local, which is 23:50 UTC the day before. To refresh a flight, SkyJourney asks the flight-data provider for that flight number on a date. It used to ask for the UTC date, which meant asking for yesterday. On a daily service the provider answered with a leg that had already flown, and copying its times moved the user’s departure 24 hours earlier.

A flight number belongs to the local day it departs on: the date on the ticket. The fix asks for that date, and turns down any answer from another local day.

New Year’s Eve had the same problem. A logbook groups flights by year, and filtering on the UTC year files a 23:30 departure from Los Angeles on 31 December under the following year. Every zone turns the year at its own instant, so the filter now respects each departure zone.

Red-eyes too. Whether a flight was overnight depends on the local hours, never the UTC ones. Auckland 15:00 to Sydney 15:50 is a daytime flight, but read as UTC it departs at 03:00. The same bug turned up in streak achievements and in the mobile app.

Clocks that move under you

One insight tells you how far your body clock was shifted by a trip. It had three bugs, which together cover most of what’s odd about time zones:

  • The date line. Offsets run from −12 to +14, so a raw difference can be far too large and point the wrong way. Honolulu to Tokyo read as 19 hours east when the clock moved 5 hours west.
  • Daylight saving during the flight. The arrival offset was read at the departure instant, which is wrong if the clocks change mid-flight.
  • Half-hour zones. India is UTC+5:30, and rounding it to 6 hours is simply wrong.

Layovers deliberately skip all of that. They are the gap between two UTC instants, because converting to local first would apply the offset twice.

Overnight, and the +1 problem

Other apps’ exports often give a date, two times and nothing else. An arrival at 06:10 after a 22:40 departure means the next day, and the importers handle that, or read an explicit +1 where the export gives one.

Two things still bite.

Corrections that look like delays. If a user fixes a mistyped date by moving the actual times by a day, the scheduled times have to move with them. Otherwise the app reports a day-long delay.

“+1” is the only offset the importers know. A flight from Tokyo just after midnight lands in Honolulu the previous day. Read with the +1 rule, it becomes a 31-hour flight. A sanity filter keeps it out of the stats, but it shouldn’t be stored like that in the first place.

Which flight did you actually take?

You bought TP6731. You flew on EK192. That’s a codeshare, and for a logbook both numbers matter: the one on the ticket is what you remember, and the operating one is what flew.

The main flight-data provider only indexes operating numbers, so searching for TP6731 finds nothing at all. When a search misses, SkyJourney looks up the codeshare, first in what it has learned before and then from a second provider. The flight is stored as the operating flight, with the marketing number alongside, so the logbook shows what flew and the check-in link goes to the airline you booked with.

Airports aren’t permanent

Palm Beach became DJT. Exports from other apps use whichever code was current when the flight was logged, so the importers keep a small list of aliases that works in both directions. A closed airport is not an alias, though: a 2015 flight to Berlin Schönefeld (SXF) did not land at Brandenburg (BER), so SXF is kept as its own airport. I’ve written more about this in the note on cleaning aviation data.

In numbers

Conversion points (in / out) 2
Import formats 8, plus TripIt, email, boarding passes and screenshots
Airport code aliases 4 pairs, both directions
Longest plausible flight 20 h

Request
clearance