<分区>
我正在使用 Python 3.7 并尝试从库中学习 datetime
模块,但我遇到了 AttributeError
。代码如下:
import datetime
t = datetime.time(4, 20, 1)
# Let's show the different components
print(t)
print('hour :', t.hour)
print('minute:', t.minute)
print('second:', t.second)
print('microsecond:', t.microsecond)
print('tzinfo:', t.tzinfo)
作为运行文件,我收到此错误 AttributeError: module 'datetime' has no attribute 'time'
请帮我找出我哪里出错了。谢谢