Flight Time Algorithm

Hey guys i know this isnt the place for this kinda stuff but maybe someone could help xD

basically i have to make a simple flight time calc which will take in the details;

Departure place/town •
Arrival place/town •
Date and Time of departure •
Date and Time of arrival to the destination (local time) •
Time difference between departing place and arrival place •

This is pretty simple, but i cant wrap my head around how to make it consider the fact that you can travel a date backwards. I dont need code i need an algorithm xD

so what i would do normally is convert time to UTC neutral and then do dep - arrival. but if the date goes back it doesnt work.

What is wrong with the good old formula: Time = Distance * Rate? Add on any complications such as weather.

Add this to your Arrival local time to get your real arrival time.

flight duration = arrival time - ( departure time + [time difference])

time difference is [zone at arrival - zone at take off]

eg. you take off in UTC+0 (London) at 10.00
you land in UTC +3 (Moscow) at 17.00

time = 17 - (10 +[+3 -  +0])  
= 17 - 13 
= 4 hours

eg. you take off in UTC+9 (Tokyo) at 14.00
you land in UTC -8 (LA) at 09.00 earlier in the same day
(Crossing the date line)

time = 9 - ( 14 + [-8 - +9])
= 9 - (14 + -17)
= 9 - -3
= 12 hours

I think

ye

ah theres a tons of post about that ;d but the thing is it doesnt require and distance and weather calculations. All it needs is to calc the flight duration. The user enters the date and time or arival/departure and how long the flight takes. it just needs to be a formula to show how it works to get the flight time i guess? xD i know its stupid. But its part of a pointless assignment.