python - 错误:UnknownTimezoneWarning:tzname IST 已识别但无法理解
问题描述
Error : UnknownTimezoneWarning: tzname IST identified but not understood. Pass `tzinfos` argument in order to correctly return a timezone-aware datetime. In a future version, this will raise an exception.
category=UnknownTimezoneWarning)
我正在使用datefinder从字符串中获取日期。
这是一个示例代码:
import datefinder
a = 'Last Updated :16th July 2020 18:00 IST'
matches = list(datefinder.find_dates(a, source = True ))
print (matches)
输出 :
UnknownTimezoneWarning: tzname IST identified but not understood. Pass `tzinfos` argument in order to correctly return a timezone-aware datetime. In a future version, this will raise an exception.
category=UnknownTimezoneWarning)
[(datetime.datetime(2020, 7, 16, 18, 0), '16th July 2020 18:00 IST')]
如何消除上述错误?(在字符串“a”中使用 UTC 代替 IST(印度标准时间)时效果很好)
解决方案
推荐阅读
- mongodb - 带有前缀的 MongoDB 查询 $lookup
- android - Android Studio 3.1.4 设计预览不渲染材料设计元素
- javascript - 如何使用ajax防止数据表中的分页重置
- android - 使用 MockWebServer 运行测试总是调用失败回调(连接异常)
- swift - 使用 swift POST 二进制数据
- fonts - 在 Debian Stretch 中管理 Xlib 的字体
- swift - 快速转换二进制,十六进制,十进制
- powerbi - Power BI 中每行包含目标值的条形图
- java - 什么是 VAN 以及如何使用 JAVA 通过 VAN 传输文件?
- r - data.table 合并 R 中不同列的部分匹配