AirportTime

raw JSON →
0.0.0 verified Fri May 01 auth: no python

Convert between local time and UTC time using IATA airport codes. Handles daylight saving time automatically. Current version 0.0.0, early development.

pip install airporttime
error airporttime not found
cause Package name typo or not installed.
fix
pip install airporttime
error ValueError: Unsupported airport code: ...
cause Non-IATA code or invalid airport.
fix
Use a valid IATA code (3 letters, uppercase). Check list of supported airports.
gotcha Time format must be 'YYYY-MM-DD HH:MM:SS' exactly. Other formats (with T, timezone offsets, etc.) may cause parsing errors.
fix Ensure input strings match the expected format. No timezone info in input string.
gotcha Only IATA airport codes are supported. ICAO codes (e.g., 'KJFK') will not work.
fix Use IATA codes (3 letters, e.g., 'JFK', 'LHR').

Basic usage: convert between local and UTC time by airport code.

from airporttime import AirportTime

at = AirportTime()
# Convert local time at JFK to UTC
utc_time = at.local_to_utc('JFK', '2026-05-01 14:30:00')
print(utc_time)

# Convert UTC to local time at LHR
local_time = at.utc_to_local('LHR', '2026-05-01 18:30:00')
print(local_time)