runtime
210 / 500
question 210 Dates Numbers & Regex · hard

Flight time across time zones

Airline timetables give departure and arrival in each airport's local time. The flight data team needs the real time in the air between them, in minutes, which has to account for the zones and for daylight saving.

Functionair_minutes(departure, dep_zone, arrival, arr_zone)
Inputslocal clock times YYYY-MM-DD HH:MM and the IANA zone of each airport, e.g. "America/Los_Angeles"
Returnsthe whole number of minutes between the two moments, as an int
ExampleLas Vegas 00:59 to Houston 05:56 on 10 January 2025 → 177
Examples
callair_minutes('2025-01-10 00:59', 'America/Los_Angeles', '2025-01-10 05:56', 'America/Chicago')returns177
callair_minutes('2025-01-10 05:00', 'America/Chicago', '2025-01-10 09:14', 'America/New_York')returns194
callair_minutes('2025-01-10 05:10', 'America/Los_Angeles', '2025-01-10 08:07', 'America/Denver')returns117

Loading your progress…

Flight time across time zones — Python practice · Runtime