python - masalah dengan output masa datetime
ringa_lee
ringa_lee 2017-05-18 10:46:51
0
2
965

1Ketahui asas PYTHON pada codecademy dan pelajari datetime

Jalankan kod:

from datetime import datetime
now=datetime.now()
#print now
print now.year
print now.month
print now.day
print now.time"

输出的问题是:  年 月 日 都没问题 就是 时间那里 不知道是啥意思。

'''2017
5
15
<built-in method time of datetime.datetime object at 0x7f7bd75f7f30>
None
ringa_lee
ringa_lee

ringa_lee

membalas semua(2)
PHPzhong
from datetime import datetime
now=datetime.now()
#print now
print now.year
print now.month
print now.day
print now.hour
print now.minute
print now.second
print now.microsecond

Tiada atribut masa

print now.date()
print now.time()
print now.timetuple()
print now.ctime()
習慣沉默
print now.tiem()
Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan