7

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.

ronak
  • 79
  • 1
  • 3

1 Answers1

15

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.

Matt Healy
  • 18,033
  • 4
  • 56
  • 56
  • Do you happen to know of a database of IATA's city codes (YTO = YKZ YTZ YYZ)? – ikegami Jan 17 '12 at 19:44
  • 1
    I don't think you'll find a module, because the problem is too simple. It's just one line of SQL. The real effort is in building and maintaining the list of airport codes, and that's not really something that belongs on CPAN. – cjm Jan 17 '12 at 23:37