Im trying to calculate flying time of a journey using PHP.
Scenario:
Deprature from Chennai 12:00 hrs
Arrival at Singapore 18:30 hrs
The timezone difference between chennai and singapore is 2H:30M so the flying time is 4H from the above scenario.
I use moment.js and I simply cant subtract ArrivalTime - DepartureTime
because the TimeZone
must also be considered.
I have got only the Airport Code as a key to find the time zone but in PHP I cant use Airport Code for timezone. What is the best way to calculate the flying time of a flight?