0
我想使用datetime
模块utcfromtimestamp
方法,但它在Ninja-IDE中不起作用。我如何解决我的问题?我想使用日期时间模块utcfromtimestamp方法,但它不能在忍者IDE中工作
我的代码:
#-*- coding: utf-8 -*-
import datetime
print (datetime.datetime.utcfromtimestamp(130130301))
而且忍者IDE 2.3中写入此错误消息:
File "C:\Users\test\Desktop\datetime.py", line 3, in <module>
print (datetime.datetime.utcfromtimestamp(130130301))
AttributeError: 'module' object has no attribute 'utcfromtimestamp'
我安装了Python 3.4和设置偏好的路径。
阅读[名称遮蔽陷阱](http://python-notes.curiousefficiency.org/en/latest/python_concepts/import_traps.html#the-name-shadowing-trap) – jfs 2015-01-21 12:49:54