Web刮擦转换UNIX时间戳到日期格式
我正在尝试使用Python中的BeautifulSoup对飞行数据网站进行固定,但是时间戳是Unix Timestamp,我如何转换为常规的DateTime格式。有几个这样的列要转换。
#scheduled_departure
result_items[0]['flight']['time']['scheduled']['departure']
输出显示为 1655781000 。我如何将其转换为 TUE,6月21日,2022年6月21日上午8:40
I'm trying to webscrape a flight data website using beautifulsoup in python but the timestamp is in unix timestamp how can i convert to regular datetime format. There are several such columns to be converted.
#scheduled_departure
result_items[0]['flight']['time']['scheduled']['departure']
and the output is shown as 1655781000. how can I convert it to Tue, Jun 21, 2022 8:40 AM
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只有一个UNIX时间,它是通过使用UTC/GMT时区创建的。这意味着您可能需要转换时区来计算时间戳。
There is only one Unix time and it is created by using the UTC/GMT time zone. This means you might have convert time zones to calculate timestamps.