How to get timezone from airport code (IATA/FAA)

后端 未结 5 2052
隐瞒了意图╮
隐瞒了意图╮ 2020-12-14 04:25

I am trying to make a PHP function that returns the UTC timezone for a given airport code (IATA/FAA).

What the function should do is something like this:

<         


        
5条回答
  •  我在风中等你
    2020-12-14 04:57

    Seeing as the question is still open I'd like to point to my very own timezone map files. For your particular purpose, the IATA tzmap seems perfect:

    https://raw.github.com/hroptatyr/dateutils/tzmaps/iata.tzmap

    Obviously, you'd have to snarf the offset in question (it depends on a date as it might change over time) from the zoneinfo files, e.g. with zdump(1).

提交回复
热议问题