所以这个问题在这里得到了回答:making output of datefinder into list不幸的是,我的代表太低了,所以我不能评论来弄清楚为什么它没有像预期的那样工作。我希望将文件名字符串转换为日期列表,这样我就可以将它们用作日期列的填充。所有文件名都包含事件日期,但它们不在图纸本身中。S")) 我没有得到转换后的对象,而是得到了以下错误: AttributeError: 'generator' object has no attribute 'strftime' 当我尝试将它
import datefinders = "entries are due by January 4th, 2017 at 8:00pm. created 01/15/2005 by ACME Inc. and associates. here Dec. 24th, 1981 at 6pm."
match = datefinder.find_dates(s)例如,从s抓取January 4th, 2017 at 8:00pm并将其转换为2017-01-04 2
我正在使用python "datefinder“库来获取"datetime”对象。然而,我遇到了一些问题,因为我有一个字符串:"the 6m day of 2012 6月“和"datefinder”库无法生成该字符串的正确日期。我试过使用Result: 2012-06-13 00:00:00
上面的结果肯定是错的,我意识到罪魁祸首是"6m“这个词。如何将字符串"the 6m day of 2012 6m d
我一直在使用datefinder包,但在保存输出时遇到了一些问题。目标:从字符串中提取日期,该字符串可以采用多种不同的格式(如4月22日或4月4日或22日至4月22日等),如果没有日期,则将值设置为“None”,并在日期列表中添加日期或无。import datefinder
sample_text = 'As of February 27, 2019matches = da