错误:UnknownTimezoneWarning:已识别出tzname IST,但无法理解

时间:2020-05-28 13:20:29

标签: python datefinder

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(印度标准时间)时,它可以正常工作)

0 个答案:

没有答案