相关疑难解决方法(0)

AttributeError:'module'对象没有属性'utcnow'

当我输入简单代码时:

import datetime
datetime.utcnow()
Run Code Online (Sandbox Code Playgroud)

,我收到错误信息:

Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    datetime.utcnow()
AttributeError: 'module' object has no attribute 'utcnow'
Run Code Online (Sandbox Code Playgroud)

但是python的文档utcnow就在这里:https://docs.python.org/library/datetime.html#datetime.datetime.utcnow.为什么utcnow我的电脑无法正常工作?谢谢!

python datetime

18
推荐指数
1
解决办法
2万
查看次数

标签 统计

datetime ×1

python ×1