API to Website Times are different?


#1

Hi,

We’re sourcing data through the FlightXML API and I think I’m seeing different times shown on your website vs what it getting returned from the API. Is the website all in UTC times or is there some kind of conversion going on?

for FaFlightID: AAL82-1490232000-schedule-0001

The website shows:
AKL to LAX
ADT: 2:28PM
Landed: 5:48am

The API returns:
FlightID: AAL82-1490232000-schedule-0001
Actual Departure time: 1490405316 (this converts to GMT: Sat, 25 Mar 2017 01:28:36 GMT)
Actual Arrival time: 1490446105 (this converts to GMT: Sat, 25 Mar 2017 12:48:25 GMT)

The arrival/landed time looks like it’s 7hrs prior to GMT, but the ADT is only 1hr different? How do match this flight to your website to verify the times I’m getting back from the API are correct? Each one looks like it’s in a different time zone? Are the times all in local times?

thanks


#2

Looks normal to me:



$ TZ=Pacific/Auckland date -d '@1490405316'
Sat 25 Mar 14:28:36 NZDT 2017
$ TZ=America/Los_Angeles date -d '@1490446105'
Sat 25 Mar 05:48:25 PDT 2017


The timezone used on the website is controlled by the “Display flights in flight’s time zone” vs “Display flights in my time zone” setting at flightaware.com/account/manage


#3

So the times are in local time zones on the website, not all in UTC?


#4

If you have your account configured to show times in the flight’s timezone, then the times are shown in the flight’s local (arrival/departure) timezone.
If you have your account configured to show times in your account’s timezone, then the times are shown in your account’s timezone.

There is also an option to always show the relevant timezone that’s being used which may help reduce your confusion here.


#5

Yes local times, got it. Couldn’t keep it straight in my head as we look at everything in UTC.

I have a separate post on how to link my API account with the website if possible, or how to register with an email so I can set the timezone preference.

thanks,
mike


#6

FlightXML2 always returns timestamps in UTC epoch format and does not attempt to do timezone conversion for you. Your account preference is intentionally not considered for FlightXML2 responses.


#7

Sorry, I was looking at the wrong website. Sometimes I crosscheck with another flight tracking site. here is the correct info on what your website shows. are the times slightly off? The data your API is returning is matching that other website I think for the minutes. here is the link I’m looking at (flightaware.com/live/flight/N802AN)

The website shows:
AKL to LAX
Departure: Sat, March 25 01:12 UTC LAX
Arrival: Sat, March 25 13:04 UTC AKL

The API returns:
FlightID: AAL82-1490232000-schedule-0001
Actual Departure time: 1490405316 (this converts to GMT: Sat, 25 Mar 2017 01:28:36 GMT)
Actual Arrival time: 1490446105 (this converts to GMT: Sat, 25 Mar 2017 12:48:25 GMT)


#8

sorry I should proof before I upload. Had the dept/arrival codes switched.

The website shows:
AKL to LAX
Departure: Sat, March 25 01:12 UTC AKL
Arrival: Sat, March 25 13:04 UTC LAX

The API returns:
FlightID: AAL82-1490232000-schedule-0001
Actual Departure time: 1490405316 (this converts to GMT: Sat, 25 Mar 2017 01:28:36 GMT)
Actual Arrival time: 1490446105 (this converts to GMT: Sat, 25 Mar 2017 12:48:25 GMT)


#9

The actualdeparturetime and actualarrivaltime from flightXML will correspond with the actual takeoff and landing times on the website. If you look at the sidebar on the right you’ll see those times. They’ll be a few minutes different, based on taxi time, from the gate depart and arrive times.


#10

Ahhh…ok now I see yes. If I click on the specific flights I’ll see the matching times.

ok, great thanks.
mike