【问题标题】:Departure times and arrival times are not displaying correctly for tequila kiwi api get Response outputtequila kiwi api get Response output 的出发时间和到达时间显示不正确
【发布时间】:2022-10-24 02:28:24
【问题描述】:

我正在摆弄 Tequila Kiwi API 来建立一个短程序,在某个窗口期内找到廉价的往返航班。但是,出发时间和到达时间是一些长整数而不是日期字符串。我用谷歌搜索我什么都做不了。

我的结果

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

来自 API 文档。它应该看起来像

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

这些是请求的参数:

 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
                 }

除了那些奇怪的格式之外,其他一切都有效aTime: 1661065200, aTimeUTC: 1661054400

【问题讨论】:

    标签: python-3.x httprequest


    【解决方案1】:

    它的UTC时间以秒为单位,在互联网的帮助下将其转换为您的时区

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-05-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多