Local time question


I read the post in http://discussions.flightaware.com/post194303.html#p194303 that your support colleague mentioned:
“…timestamps using UTC timezones. They are sort of fake timestamps. If you explain what local times you want to use, I can show you another conversion. It is a bit confusing but it is an old call that could be improved."

We need the resultant timestamps for departure and arrival to be the exact local time e.g Toronto time. How can we do that?


The text you are quoting is in regards to input timestamps for that function.

Returned timestamps from all FlightXML functions are always epoch (UTC) and you will need to convert them to localtime yourself if you want something else. Once you know the epoch timestamp that you want to convert and know what airport code it belongs to (origin vs destination), then you can use the AirportInfo function to look up the timezone identifier for it (such as “America/Toronto” for Toronto). Then you simply use your language’s builtin functionality to convert the timestamp into that identifier.

See this wikipedia article for more information about the timezone identifiers we use, though in most cases you don’t need to actually parse the zonefiles yourself since your language does it for you: en.wikipedia.org/wiki/Tz_database