Understand IATA codes, timezone traps, and local-time semantics in flight data
domain: travel-general · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
Steps
IATA airport codes (3-letter, e.g. JFK) and city codes (also 3-letter, e.g. NYC) are distinct — city codes may map to multiple airports; always resolve to airport code before passing to booking APIs.
Flight departure and arrival times in booking APIs are almost always expressed in local time at the respective airport, not UTC — a 14:00 departure from LHR means 14:00 London local time.
To compute flight duration correctly, convert both departure and arrival local times to UTC using the IANA timezone identifier for each airport (e.g. Europe/London, America/New_York), then subtract; never subtract local times directly.
Overnight flights and DST transitions can make naively computed durations wrong by an hour or more — always use a timezone-aware library (e.g. Python's zoneinfo or JavaScript's Temporal API) for these calculations.
Airport timezone data is not included in most flight APIs — maintain or source a mapping of IATA airport code to IANA timezone (e.g. from OpenFlights or a maintained open dataset) and join it locally.
When displaying times to users, show local time with explicit timezone abbreviation (e.g. '14:00 BST') plus the UTC offset; never show bare local time without context.
Known gotchas
Some airports span timezone boundaries or have historically changed timezone rules — always use current IANA timezone data (keep the tzdata package updated) rather than hardcoded UTC offsets.
Codeshare flights may list the marketing carrier's flight number but operate on a different physical aircraft with a different airline's schedule — the operating carrier's timezone rules apply for actual departure/arrival.
IATA codes are occasionally reassigned or retired; a code valid at search time (e.g. for a newly opened airport) may not yet be in an older local copy of the airport database — refresh reference data regularly.
Give your agent this knowledge — and 15,500+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?