Where the arithmetic actually happens
The departure time you type is a reading on a clock in one city, which by itself names no particular moment — the same reading occurs at twenty-four different instants around the world. It is first turned into an absolute instant using the offset that city was on for that date. The flight time and any layover are added to the instant, which is the only place duration arithmetic belongs. The resulting instant is then read back on the destination clock. Midnight crossings and the international date line fall out of that automatically: nothing special happens at either, because the instant is continuous and only the reading changes. A date line crossing simply means the two readings differ by close to a whole day.
It uses the real time zone database, not fixed offsets
This is worth stating plainly, because it is the difference between a tool that is right and one that is right for ten months a year. The offsets are looked up in the IANA time zone database that ships with your browser, at the exact instant of each event. So a flight into London in July gets British Summer Time and the same flight in January does not. Phoenix stays on Mountain Standard Time all year while Denver does not. Sydney and Auckland go the other way from the northern hemisphere. A flight that takes off the night before a clock change and lands after it is handled correctly, because each end is read at its own instant rather than sharing one assumed offset. The abbreviation shown next to each city — EDT, GMT, JST — is the one actually in force on that date, so it is a quick check that the tool and your ticket agree.
Two limits go with that. The database only contains rules that have been published, so a country announcing a change to its clocks after your browser last updated will not appear. And zones are regions rather than airports: a country split across several zones needs the correct city chosen, which matters most in the United States, Australia, Canada and Brazil.
Connections
Choosing a connecting city shows the landing time and re-departure time on the connection city clock, and adds the layover to the door-to-door total. That total is the number worth comparing between itineraries. Two routings can advertise similar flying time and differ by five hours once the ground time is counted. Layover length has a floor set by the airport and the airline — a published minimum connection time — and a single ticket will never be sold below it. The real exposure is separately booked tickets: if the first flight is late, the second airline owes you nothing and is under no obligation to wait, so leave far more room than the minimum suggests. Changing terminals, clearing immigration or re-checking bags each add to it.
What the number is and is not
This is the arithmetic of an itinerary you describe. Actual flights sit on the taxiway, get routed around weather and pick up or lose time to the jet stream, and the times printed on a ticket are gate-to-gate rather than wheels-up to wheels-down, which is why a scheduled flight time is usually a little longer than the flying time. If a booking exists, the arrival time on the booking is authoritative and this will only tell you why that time is what it is. The one figure here you will not find on a ticket is what your own watch reads on landing — the honest measure of how long the day was, and generally a better guide to how you will feel than the local time on arrival.
Questions people ask
Why do I sometimes land earlier than I took off?
Because the destination clock is behind the one you left. A flight leaving Tokyo at 5 pm and taking seven hours lands in Honolulu at about 7 am the same morning: nineteen hours of clock difference against seven hours of flying. Nothing was gained. Your watch will read midnight, and the elapsed figure in the results shows the seven hours your body actually spent.
Is daylight saving handled, or do I have to allow for it?
It is handled. Offsets are read from the browser IANA database for the actual instant of departure and the actual instant of arrival, so the answer is right on either side of a clock change and right for a flight that crosses one. There is no daylight saving switch to set, because there is nothing to guess.
How much layover should I leave?
More than the airport minimum. An international-to-international connection in one terminal with bags checked through can work in about an hour; changing terminals or clearing immigration wants two or three. Where it really matters is separately booked tickets, since a missed connection there is entirely your problem and your cost.
My city is not on the list.
Pick any city in the same time zone; only the zone is used, so Vienna behaves exactly like Berlin and San Diego like Los Angeles. Take care in countries split across zones — the wrong US or Australian city is off by an hour or more, and the wrong Brazilian one can be off by a date at the margins.