Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find timezone from airport code using perl code

Tags:

timezone

perl

gmt

As I am right now working on blocking the particular flight to display if the departing time is with in 3 hours of booking time. As, I need to get the timezone of the departing airport to convert it to GMT and thus get the proper difference between the time of booking and departing time of flight. I have searched for many CPAN modules to do the mapping between the airport code and the timezone but I didn't get any proper solution.It will be great if anybody will helpful to me in finding some good solution to it.

like image 352
ronak Avatar asked Jan 17 '12 11:01

ronak


1 Answers

I don't know if you will find a CPAN module, but perhaps you can make a converter yourself - it should be simple enough with a small database table mapping airport codes to timezones.

I found the following link containing a CSV file of over 5,000 airport codes and their timezone relative to UTC.

http://openflights.org/data.html

You can import the CSV from that link into your own database and then have your code work around the timezones and airports in that table.

like image 93
Matt Healy Avatar answered Sep 23 '22 00:09

Matt Healy