date_str = datetimenowstrftimeY-m-dAttributeError module datetime has no attribute now这个是什么问题
这个问题可能是因为在代码中没有正确导入datetime模块。可以尝试在代码开头添加以下导入语句:
from datetime import datetime
如果已经导入了datetime模块,可能是因为在代码中使用了与datetime同名的变量或函数,导致模块中的now()函数无法访问。可以尝试更改变量或函数名,以避免命名冲突。
原文地址: https://www.cveoy.top/t/topic/gtus 著作权归作者所有。请勿转载和采集!