Google App Engine从datetime模块中引发此错误

时间:2015-01-15 21:09:31

标签: google-app-engine

  File "C:\Users\Savion\Documents\GitHub\petition-app\models\petition.py", line 55, in get_in_effect_petitions
return Petition.gql('WHERE date_added >= :1', datetime.now() - timedelta(14))
AttributeError: 'module' object has no attribute 'now'

我试图运行请愿网站,Google App Engine会抛出上述错误。有问题的模块显然是日期时间模块。任何想法如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

为了完成并对问题有一个有效的答案,请将Brent Washburne的评论复制到答案中:

 datetime.datetime.now() 

应该有效