小编Dik*_*rki的帖子

'...' in time(...) 在python的timedate类中是什么意思?

我是 python 编程的新手datetime。我正在学习模块。但是,更进一步,我看到:

from datetime import datetime
t = datetime.time()
print ("The current time is ", t)
Run Code Online (Sandbox Code Playgroud)

但是,我得到的错误是:

TypeError                                 Traceback (most recent call last)
<ipython-input-109-91a2f569ccbd> in <module>
      8 #print(type(datetime.time()))
      9 # Get the current time
---> 10 t = datetime.time()
     11 
     12 print ("The current time is ", t)

TypeError: descriptor 'time' of 'datetime.datetime' object needs an argument
Run Code Online (Sandbox Code Playgroud)

所以我试图在我的 juypter 笔记本中查看日期时间的帮助:

class datetime(date)
 |  datetime(year, month, day[, hour[, minute[, second[, microsecond[,tzinfo]]]]])
 |  
 |  The year, month and day …
Run Code Online (Sandbox Code Playgroud)

python python-3.x jupyter-notebook

1
推荐指数
1
解决办法
130
查看次数

标签 统计

jupyter-notebook ×1

python ×1

python-3.x ×1