Search code examples
python-3.xhttprequest

Departure times and arrival times are not displaying correctly for tequila kiwi api get Response output


I was fiddling with Tequila Kiwi API to set up a short program that finds cheap round flights within some window period. However, departure times and arrival times are some long integer stead of the date strings. I googled around I could not anything.

My result

            'aTimeUTC': 1661054400,
            'airline': 'ET',
            'bags_recheck_required': False,
            'cityCodeFrom': 'YTO',
            'cityCodeTo': 'ADD',
            'cityFrom': 'Toronto',
            'cityTo': 'Addis Ababa', ...

From API documentation. It should look like

          "local_arrival": "2021-04-02T09:07:00.000Z",
          "utc_arrival": "2021-04-02T13:07:00.000Z", ....

These are the parameters for the request:

 query = {"fly_from": self.home_town,
                 "fly_to": fly_to,
                 "date_from": date_from,
                 "date_to": date_to,
                 "curr":"CAD",
                 "flight_type":"round",
                 "nights_in_dst_to": 120,
                 "nights_in_dst_from": 30
                 }

Everything else works except for those weirdly formatted aTime: 1661065200, aTimeUTC: 1661054400


Solution

  • its utc time in second, convert that into your time zone the help of internet